Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
Adding custom fields to post content within a category « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Adding custom fields to post content within a category

(3 posts)
  • Started 5 years ago by JerryRobinette
  • Latest reply from tzShaper
  • This topic is not resolved
  1. JerryRobinette
    Member

    I have two categories of posts that have custom fields attached to. For example, I have a category called "events" and I have created the following custom fields:

    event_location
    event_address
    event_phone
    event_website

    I want to display the the custom field data after the post title but, I only if the post categorized as "events".

    Can someone please give me some guidance please?

    Posted 5 years ago #
  2. JerryRobinette
    Member

    OK. I got the below to work. But it there has to be a more efficient way to do this.

    if(get_post_meta($post->ID, "event_location", $single = true) != "") :

    echo 'Location: ';
    echo get_post_meta($post->ID, "event_location", $single = true);
    echo '
    ';

    endif;

    if(get_post_meta($post->ID, "event_address1", $single = true) != "") :

    echo 'Address1: ';
    echo get_post_meta($post->ID, "event_address1", $single = true);
    echo '
    ';

    endif;

    if(get_post_meta($post->ID, "event_address2", $single = true) != "") :

    echo 'Address2: ';
    echo get_post_meta($post->ID, "event_address2", $single = true);
    echo '
    ';

    endif;

    if(get_post_meta($post->ID, "event_city", $single = true) != "") :

    echo 'City: ';
    echo get_post_meta($post->ID, "event_city", $single = true);
    echo '
    ';

    endif;

    if(get_post_meta($post->ID, "event_state", $single = true) != "") :

    echo 'State: ';
    echo get_post_meta($post->ID, "event_state", $single = true);
    echo '
    ';

    endif;

    if(get_post_meta($post->ID, "event_zip", $single = true) != "") :

    echo 'Zip: ';
    echo get_post_meta($post->ID, "event_zip", $single = true);
    echo '
    ';

    endif;

    if(get_post_meta($post->ID, "event_phone", $single = true) != "") :

    echo 'Phone: ';
    echo get_post_meta($post->ID, "event_phone", $single = true);
    echo '
    ';

    endif;

    if(get_post_meta($post->ID, "event_tty", $single = true) != "") :

    echo 'TTY: ';
    echo get_post_meta($post->ID, "event_tty", $single = true);
    echo '
    ';

    endif;

    if(get_post_meta($post->ID, "event_email", $single = true) != "") :

    echo 'Email: ';
    echo get_post_meta($post->ID, "event_email", $single = true);
    echo '
    ';

    endif;

    if(get_post_meta($post->ID, "event_website", $single = true) != "") :

    echo 'Website: ';
    echo get_post_meta($post->ID, "event_website", $single = true);
    echo '
    ';

    endif;

    Please help this nOOb.

    Posted 5 years ago #
  3. tzShaper
    Member

    You should have a look at wefunction.com articles.
    Just posted is a revision to "custom write panels".
    The example shows an events venue setup.
    It may be a better route for you, it's similar to using the flutter plugin.

    Posted 5 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183