Title: Query posts and custom fields
Last modified: August 19, 2016

---

# Query posts and custom fields

 *  Resolved [steverydz](https://wordpress.org/support/users/steverydz/)
 * (@steverydz)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/query-posts-and-custom-fields/)
 * I am trying to display 4 posts from a particular category at the top of my homepage
   and the 5 lasted posts from all other categories in a different section of my
   homepage. A little bit like this:
 * [http://www.elliotjaystocks.com](http://www.elliotjaystocks.com)
 * The category along the top is inserted with a custom field called ‘Thumbnail’.
   I would like 4 of these to appear across the top of the page.
 * I then want a regular style blog at the bottom of the page showing the latest
   posts but excluding the portfolio thumbnails.
 * I have looked everywhere and cannot find a solution.

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

 *  [Peter Boosten](https://wordpress.org/support/users/pboosten/)
 * (@pboosten)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/query-posts-and-custom-fields/#post-1235074)
 * How do you know these thumbnails are inserted through Custom Fields?
 * Custom fields are part of a post/page, why not create 4 thumbnails in your xhtml?
 * Peter
 *  Thread Starter [steverydz](https://wordpress.org/support/users/steverydz/)
 * (@steverydz)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/query-posts-and-custom-fields/#post-1235075)
 * I’ve seen a screen cast where he explains thats how he inserts them. I can insert
   them in manually however I need them to be dynamic as I update my portfolio.
 *  [Peter Boosten](https://wordpress.org/support/users/pboosten/)
 * (@pboosten)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/query-posts-and-custom-fields/#post-1235076)
 * ah, oke. What exactly is the problem you’re facing?
 * Peter
 *  Thread Starter [steverydz](https://wordpress.org/support/users/steverydz/)
 * (@steverydz)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/query-posts-and-custom-fields/#post-1235092)
 * I can’t seem to separate the loops basically. Obviously I’m going about this 
   the wrong way.
 * I used the query post tag with showposts=4 for the images and for the blog I 
   want to use a regular loop to display the last 5 posts excluding the portfolio.
 * My problem is that both loops are reading the showposts from both sections and
   therefore I can’t keep the right number of posts in each section.
 *  [Peter Boosten](https://wordpress.org/support/users/pboosten/)
 * (@pboosten)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/query-posts-and-custom-fields/#post-1235093)
 * Did you read [this](http://codex.wordpress.org/The_Loop#Multiple_Loops)?
 * Peter
 *  Thread Starter [steverydz](https://wordpress.org/support/users/steverydz/)
 * (@steverydz)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/query-posts-and-custom-fields/#post-1235095)
 * No I haven’t seen that. Thank you, hopefully it will help.

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

The topic ‘Query posts and custom fields’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * 6 replies
 * 2 participants
 * Last reply from: [steverydz](https://wordpress.org/support/users/steverydz/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/query-posts-and-custom-fields/#post-1235095)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
