If Statements for Categories
Anyone know the exact PHP code to change loop ad listings behavior based on categories.
Let me clarify by using the soldout ribbon I found from samcy here.
we have this:
PHP Code:
<?php if (get_post_meta($post->ID, 'cp_ad_sold', true) == 'yes') echo '<span class="soldout-ribbon-list"></span>'; else echo ''; ?>
I understand it grabs the meta data and if sold is yes it shows the ribbon.
Lets say we want to add a facebook share button for only certain categories. But only if it is NOT sold. How do we do this? I dont know the language very well so I will explain in english.
IF cp_ad_sold, true = no AND the category is a,b, or c than "display facebook share button"
IF cp_ad_sold, true = yes AND the category is a,b, or c than "display soldout ribbon list"
IF category is x,y,z than 'display another span' a
and if its anything else do nothing?
Let me know if you understand (hopefully) or I will try to clarify more