Excluding categories and specific plugin categories.
-
Hi,
I’ve been using a conditional tag in my loop.php file to modify the height and width of my featured image for a particular category, as below:
if (is_category('Lifestyle 生活方式')) { ! get_the_image( array( 'size' => 'thumbnail', 'width' => 25, 'height' => 25, 'before' => '<div class="cover">', 'after' => '</div>' ) ); }else{ get_the_image( array( 'size' => 'thumbnail', 'width' => 228, 'height' => 160, 'before' => '<div class="cover">', 'after' => '</div>' ) ); } ?>
I have two questions I hope will be fairly easy to answer!
1. Rather than resize the image, is it possible to actually hide it (or the div) modifying the code above, just for that category?
2. On this page, I can’t seem to ‘target’ the category like above. I’ve tried
if (is_category('SD俚语词典'))
but no luck. The category is created by an Encyclopedia plugin so i think this may be the reason. I’m stumped!Thank you for any help you’re able to give. I’ve only been delving into php for about 10 hours so any help is very much appreciated!
- The topic ‘Excluding categories and specific plugin categories.’ is closed to new replies.