I have tried 3543657 to do this in the post, but with no succes.
<?php if (is_category('34')) { ?>
<p>This is category 34</p>
<?php } ?>
I want when i open some post in category ID 34,35,36 or 37 or 38 to show somewhere in the post the text "This is category"
Thanx in advance ;)
You need a plugin to put code in a post so look at http://wordpress.org/extend/plugins/exec-php/
And if you are wanting to know of a post being in a particular category use the in_category().
The loop article has an example.
I put this code in single.php in the loop... and is not working...
i tried also this:
<?php if (is_category('1')) { ?>
<p>This is category 1</p>
<?php }else { ?>
<?php } ?>
and this:
<?php if (is_category('1')) : ?>
<p>This is category 1</p>
<?php }else : ?>
<?php : ?>
and this:
<?php if( is_category('3, 14, 55, 11') ) echo 'Hello';
elseif echo 'Goodbye';?>
but no one of them works....
It works! Thank you :)
I tried this
<?php if (in_category('1')) { ?>
<p>This is category 1</p>
<?php }else { ?>
<?php } ?>