• Hi,

    I’m new to wordpress and my theme doesn’t allow me to display posts from more than one category on “index.php.” Can someone please give me some sample code to do that. I want to display items from categories 2 and 3. I know there’s documentation but I couldn’t figure out how to use the queries.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • if your theme is “default” try to replace

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    whit this

    <?php
    $my_query = new WP_Query('cat=2,3');
    while ($my_query->have_posts()) : $my_query->the_post();
    ?>

    Thread Starter xxhoixx

    (@xxhoixx)

    My theme is the bloggingstream from Woo Themes. The code is like this:

    <?php while (have_posts()) : the_post(); $count++;?>

    <span class=”heading”><?php _e(‘Latest Article’,woothemes); ?></span>

    <?php if ( get_option( ‘woo_featured_layout’ ) <> “” ) { include_once( TEMPLATEPATH . ‘/featured-layouts/’ . get_option( ‘woo_featured_layout’ ) ); } else { include_once( TEMPLATEPATH . ‘/featured-layouts/large_no_ad.php’ ); } ?>

    <?php if ( $count == 1 ) { break; } ?>

    <?php endwhile; ?>

    Basically, what I want to do is say: On top show category 2 and on bottom show category 3. I don’t want them to be together but I do want them on the same page.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display multiple categories in "index.php"’ is closed to new replies.