How do I conditionalize this?

I’m looking to make a small tweak in workpress.

I’d like to conditionalize this piece of code to not execute (displays the date of the post) if a certain category (category 503) is used.

[php]

<?php the_time('M');?><?php the_time(‘j’);?

[/php]

Any suggestions?

try using in_category( $category, $_post )

like:

[php]if ( in_category(503)) {[/php]

Parameters

$category
(mixed) (required) One or more categories specified by ID (integer), name or slug (string), or an array of these

    Default: None 

$_post
(mixed) (optional) The post (integer ID or object). Defaults to the current post in the Loop or the post in the main query.

    Default: None 

source: http://codex.wordpress.org/Function_Reference/in_category

Sponsor our Newsletter | Privacy Policy | Terms of Service