• Resolved Maxaud

    (@maxaud)


    Hello,
    I’m designing a site for a friend where he can submit featured listings (he’s a realtor) and they get put into a featured listings category. I’m using keys/values for him to define stuff like price, locations, acres, etc. and would like to display this info on the individual posts pages.

    I’ve tried editing single.php and if I enter the code (this code for each different key/value):
    <?php $key="List Price"; $value =get_post_meta($post->ID, $key, true); echo "Price: $".$value; ?> <br />
    It shows up how I’d like it to but at the same time it adds the “Price:” text to EVERY post in the site (Not all posts are featured listings posts).

    I’ve also used the_meta() and that seems to work though I’d like for it not to be in alphabetical order and I’d like to have more control over it.

    Is there any fixes for this?
    I’ve tried everything I could find.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘displaying key/value on posts only in a certain category while on posts page’ is closed to new replies.