Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Comments, trackbacks & pings (http://forum.bytesforall.com/forumdisplay.php?f=19)
-   -   [SOLVED] Remove multiple comment footers per category (http://forum.bytesforall.com/showthread.php?t=5187)

WesleyTack Jan 7, 2010 04:39 AM

[SOLVED] Remove multiple comment footers per category
 
Hi,
I had a question about a thread that is closed, the thread in question is:

http://forum.bytesforall.com/showthread.php?t=4623

There is a line there that works, but I want it to work on multiple categories:

<?php if (!in_category('5')) { bfa_post_footer('<div class="post-footer">','</div>'); } ?>

I was wondering if you can add more than one category to this? I tried making it: ('5', '6') but that doesn't work. I'm not sure if you CAN add more than one category?

Thanks in advance!

juggledad Jan 7, 2010 05:10 AM

Yes you can use an array the code would be
HTML Code:

<?php if (!in_category(array('5', '6'))) { bfa_post_footer('<div class="post-footer">','</div>'); } ?>
you can ues the actual category names, so it could be
HTML Code:

<?php if (!in_category(array('Weather', 'News'))) { bfa_post_footer('<div class="post-footer">','</div>'); } ?>
the 'is_xxxxxx()' are all WordPress functions that can be found at http://codex.wordpress.org/Conditional_Tags

WesleyTack Jan 7, 2010 08:28 AM

Oh, I forgot about the array code, being able to use the actual category names is a nice tip as well, good to know! Thanks for the quick response. Everything works now.


All times are GMT -6. The time now is 05:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.