Steve519
Member
Posted 3 years ago #
I run http://www.platformnation.com, I'm looking for a way to edit our theme so it would show a disclaimer after the title but before the body for just certain categories that we have on our page.
How would I go about doing this?
Any help on this would be greatly appreciated!
Thanks!
Try adding:
<?php if( is_category( array( 'Foo', 'Bar', 'Test') ) ) :?>
[ insert disclaimer text & markup here ]
<?php endif;?>
to your theme's category.php file (or archive.php if you don't have a category template file).
Steve519
Member
Posted 3 years ago #
not working. At least not the way I'm trying to get.
I don't have a category.php file in my template. And I'm trying to add the text after the title and before the body on the single.php or single page.php view.
Steve519
Member
Posted 3 years ago #
ok, figured it out, instead of is_category i needed in_category for my needs
This worked for me:
<?php if( in_category( array('275', '22592', '12869', '23648','309', '6658', '310') ) ) :?>
<p>Disclaimer:text here.</p>
<?php endif;?>
Now is there a way I could put some sort of outline box around this?
Steve519
Member
Posted 3 years ago #
nevermind the outline box, I went about it a different way. Thanks esmi for your help!