Wordpress category

This is code from my wordpress homepage template. There are 3 same code, like this one bellow. The question is how can I put different categories to show different news when I post. At the moment code is same on my homepage and it show only category named World, it's the first category created. How can I setup the rest of code with different categories.

Currently it's like this : http://zaslike.com/files/os8hvxg38oendfwcvrz6.png I need to put other categories instead same three.

http://justpaste.it/e0nh - Here is the code of homepage template.


  • autistic

    I believe you are asking for this:

    <!-- Your Query -->
    <?php  // The Query
           query_posts( array ( 'category_name' => 'change-to-category-name', 'posts_per_page' => 1 ) ); ?>
    <?php // The Loop
          while ( have_posts() ) : the_post();?>
        // YOUR HTML GOES HERE        
        <?php endwhile; ?>
    <?php // Reset Query
          wp_reset_query(); ?> // DON'T FORGET THIS

    Use this code at the parts of the site that display your categories change the categories name to the ones you want to display and you are good to go.

    Good luck welcome to SO.

Add Comment