php - Multiple wordpress category IF conditional tags -


hi there posted question other day using conditional tags, managed solve.

i've encountered obstacle, i've managed 1 working saying "if posts in 'blogs' category echo '[blogs]'" i'm trying display posts in blogs category , another. read use multiple conditional tags use 'elseif' have doesn't seem have done anything. here code i'm using:

<h2>     <a href="<?php the_permalink() ?>" rel="bookmark" title="permanent link <?php the_title_attribute(); ?>">         <?php if (in_category ('blogs')) { ?>             <?php _e('[blog]'); ?>         <?php } elseif (in_category ('blogs', 'showstopper-spillings')) { ?>             <?php _e('[blog] showstopper spillings:'); ?>         <?php } ?>         <?php the_title(); ?>     </a>   </h2> 

not sure if i'm missing anything, or i'm trying possible. or advice appreciated.

in_category takes 1 category @ time. accordingly, need use compound statements evaluate multiple categories.

<?php   if (in_category ('blogs')) {          _e('[blog]'); } elseif (in_category ('other_category')) {         _e('other category:'); } ?> 

substitute other_category either category id or category name or category slug of desired category.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -