Results 1 to 2 of 2

Thread: Get Custom Field

  1. #1
    Thread Starter
    Junior Member wesleyj77's Avatar
    Join Date
    Feb 2012
    Location
    United States
    Posts
    26
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Get Custom Field

    I'm sure that there is a function to easily do this or that I'm on the right track but, did something wrong. I created a custom field with 3 checkboxes. I need to get that custom field and see which checkboxes are selected in order to determine the visibility of some options in sidebar-contact.php. I thought that I would be able to use get_post_meta but, this doesn't work. I assume because the value returned is an array. Assuming that it was an array I tried

    $contactMethods = explode(',',get_post_meta($post->ID, 'cp_contact_methods'));
    foreach ( $contactMethods as $name)
    ...

    This didn't work for me either. Any help would be appreciated.

    Thanks,

  2. #2
    Thread Starter
    Junior Member wesleyj77's Avatar
    Join Date
    Feb 2012
    Location
    United States
    Posts
    26
    Thanks
    1
    Thanked 2 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom field type field problem 3.1
    By weiching in forum Report ClassiPress Bugs
    Replies: 12
    Last Post: October 31st, 2014, 03:01 AM
  2. Add datepicker to custom field as a field type
    By ellie in forum ClassiPress General Discussion
    Replies: 44
    Last Post: April 10th, 2014, 05:45 AM
  3. Replies: 18
    Last Post: October 9th, 2011, 11:24 PM
  4. Inserting a custom field from a custom form into the listing preview
    By Fanatic in forum ClassiPress General Discussion
    Replies: 4
    Last Post: May 1st, 2011, 07:17 PM
  5. [SOLVED] Custom field order in frontend doesn't match with custom field order set in backend
    By bluecafe in forum Report ClassiPress Bugs
    Replies: 11
    Last Post: November 24th, 2010, 08:47 AM