Category Specific Custom Field Display
-
Hello,
I’m wanting to display a custom field but only on posts in a specific caterogy (Releases, which is the parent category). I’ve put together the following, and tried it on both my themes single.php & index.php files. At present, the data is displaying on all posts/all categories. Any ideas why, does this code look okay?
<?php $values = get_post_custom_values("iTunes"); { if(!empty($values)); if (in_category('releases')); echo "Available On " . "<a target=_blank href=$values[0]>iTunes</a>" . '<br />' . '<br />'; } ?>
PS: iTunes is the name of the custom field, and the text should display as Available On iTunes, with ‘iTunes’ being a link
Regards
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Category Specific Custom Field Display’ is closed to new replies.