• I use this

    query_posts(‘cat=63,50’);

    to display posts that belong to either/or all these categories.

    In a certain block I want to display items which are common to BOTH these two categories.

    I am using

    if ( in_category(’50’) || in_category(’63’) );
    $posts = get_posts(‘numberposts=5’);
    if( $posts ) :
    foreach( $posts as $post ) : setup_postdata( $post );
    **** SHORT BODY TEMPLATE STUFF ****
    endforeach;
    endif;

    DOESN’T WORK.

    This displays posts from ALL categories on the site.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditional statements and common categories’ is closed to new replies.