Title: Working with category
Last modified: August 19, 2016

---

# Working with category

 *  [raphaelfs](https://wordpress.org/support/users/raphaelfs/)
 * (@raphaelfs)
 * [17 years ago](https://wordpress.org/support/topic/working-with-category/)
 * Hi guys,
 * first of all, sorry for te english!
 * I want to use wordpress with some specifications. I draw my idea at photoshop
   to make things easier.
 * You can see what i want going to:
    [http://www.cavern.com.br/howto.jpg](http://www.cavern.com.br/howto.jpg)
 * Is it possible?
    How?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [equaldesign](https://wordpress.org/support/users/equaldesign/)
 * (@equaldesign)
 * [17 years ago](https://wordpress.org/support/topic/working-with-category/#post-1105429)
 * This should help you:
 * [http://codex.wordpress.org/Template_Tags/query_posts](http://codex.wordpress.org/Template_Tags/query_posts)
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [17 years ago](https://wordpress.org/support/topic/working-with-category/#post-1105430)
 * Try looking through the [Theme Directory](http://wordpress.org/extend/themes/)
   for 3-column themes.
 *  Thread Starter [raphaelfs](https://wordpress.org/support/users/raphaelfs/)
 * (@raphaelfs)
 * [17 years ago](https://wordpress.org/support/topic/working-with-category/#post-1105443)
 * Hi equaldesign and esmi!
 * First, i tried to work with “Query Posts”, but i got in trouble. I don’t know
   where should i put these code.
 * Reading the page that ‘equaldesign’ send me, i see that i have to include
 * “
    query_posts(‘cat=1’);
 * “
    to show only the posts from Category ID=1
 * However, where should i write these code? In what file?.
 * And Esmi, a template with 2 column isn’t enough? Or 3 is better?
 * Thanks a lot!!
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [17 years ago](https://wordpress.org/support/topic/working-with-category/#post-1105470)
 * Here’s example of using multiple loops to retrieve different sets of posts:
    
   [http://www.daobydesign.com/blog/2007/07/modifying-wordpress-front-page/](http://www.daobydesign.com/blog/2007/07/modifying-wordpress-front-page/)
 *  Thread Starter [raphaelfs](https://wordpress.org/support/users/raphaelfs/)
 * (@raphaelfs)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/working-with-category/#post-1105692)
 * Here’s what i got…
 * i’ve tryed a lot of thing to resolve this problem, but nothing fix it.
 * Bellow is the start of my “index.php” file:
 *     ```
       <?php get_header(); ?>
       <?php
   
       query_posts('cat=4');
   
       query_posts('showposts=5');
   
       ?>
   
       <?php if (have_posts()) : ?>
       <?php while (have_posts()) : the_post(); ?>
   
       <!--Start Post-->
   
       <div <?php post_class(); ?> style="margin-bottom: 40px;">
   
       <div class="p-head">
       <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
       <small class="p-time">
       ```
   
 * Here’s the start of file “page.php”
 *     ```
       <?php
   
       query_posts('cat=1');
   
       //The Query
       query_posts('showposts=5');
   
       //The Loop
       if ( have_posts() ) : while ( have_posts() ) : the_post();
        ..
       endwhile; else:
        ..
       endif;
   
       //Reset Query
       wp_reset_query();
   
       ?>
       <?php get_header(); ?>
       <?php if (have_posts()) : ?>
       <?php while (have_posts()) : the_post(); ?>
   
       <div class="post" id="post-<?php the_ID(); ?>">
   
       <?php
           global $post;
           $the_newest = get_posts(‘numberposts=1′);
           $the_newer = get_posts(‘numberposts=3&offset=1′);
           $the_new = get_posts(‘numberposts=5&offset=4&order=DESC&orderby=post_date’);
       ?>
   
       <div class="p-head">
       ```
   
 * What should I do?
    I really need help! Thanks!
 *  Thread Starter [raphaelfs](https://wordpress.org/support/users/raphaelfs/)
 * (@raphaelfs)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/working-with-category/#post-1105700)
 * nobody?
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/working-with-category/#post-1105716)
 * Best bet is look at how another theme does those kind of blocks. If I remember
   the Everson News theme does that and there a others…

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Working with category’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 12 months ago](https://wordpress.org/support/topic/working-with-category/#post-1105716)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
