• Resolved AlternativePhotography

    (@alternativephotography)


    I’m trying to exclude certain categories from home. Whatever i tried does not work, can anyone give me a hint please?
    Here is the code:

    <?php
    $posts = query_posts($query_string . '&posts_per_page=20');
    while ( have_posts() ) : the_post() ?>
    
    <div class="thumbnail">
    
    <h2 style="margin:0px; padding:0px">
    <?php
    $category = get_the_category();
    echo $category[0]->cat_name;
    ?>
    </h2>
    
    <div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>">
    
    <h3 class="entry-title" style="margin-top:0px; padding-top:0px">
    <div class="floatright" style="padding:0px">
    <?php the_post_thumbnail( 'thumbnail' ); ?>
    </div>
    
    <a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'sandbox'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><?php the_title() ?></a></h3>

    I’ve tried this (does not work):

    $cats_to_exclude = array(

    69, // Call for entries

    16, // Competitions

    70, // Meetings & talks

    71, // Exhibitions

    72, // Workshops

    );

    Any better ideas? Very grateful!

Viewing 5 replies - 16 through 20 (of 20 total)
Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘How to exclude categories from home?’ is closed to new replies.