/ Published in: PHP
For use on a single page... Only displays the content if the displayed post is in the specified category. You can use the category slug or the category ID if you know it.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php if (in_category('events')) : ?> <div class='eventinfo'> <h2>Event Details</h2> <?php the_meta(); ?> </div> <?php endif; ?>