Title: query_posts problem!
Last modified: August 20, 2016

---

# query_posts problem!

 *  [nesta303](https://wordpress.org/support/users/nesta303/)
 * (@nesta303)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/)
 * Hi everyone!
 * when i run a category query i only get the right foratting in the first 2 posts,
   the rest just go into a mayhem of <p> tags, one inside each other
 * can anyone has any idea what wrong?
 * _[[code moderated - the forum limit for posting code is **10 lines **- for any code longer than that, use the pastebin; also make sure to mark any direct posted short code]](http://codex.wordpress.org/Forum_Welcome#Posting_Code)_

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/query_posts-problem-2/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/query_posts-problem-2/page/2/?output_format=md)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778028)
 * possibly some problems such as unmatched opening and closing html tags _within
   the content _of the posts.
 * please post a link to your site to illustrate the problem.
 *  Thread Starter [nesta303](https://wordpress.org/support/users/nesta303/)
 * (@nesta303)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778029)
 * thank you for the quick reply!
 * but i’m working on a local server. can i paste the output html or the php file
   itself somewhere?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778033)
 * > can i paste the output html or the php file itself somewhere?
 * you can paste any code using the [http://pastebin.com/](http://pastebin.com/)–
   
   instructions are in here: [http://codex.wordpress.org/Forum_Welcome#Posting_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)
 *  Thread Starter [nesta303](https://wordpress.org/support/users/nesta303/)
 * (@nesta303)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778035)
 * OK so heres the entire category page [pastebin link](http://pastebin.com/RYeZQ5nD)
 *  Thread Starter [nesta303](https://wordpress.org/support/users/nesta303/)
 * (@nesta303)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778210)
 * I solved the issue by running a WP_Query instead and adding classes to hook-up
   in css later:
 * <?php
    $featuredPosts = new WP_Query(); $featuredPosts->query(‘showposts=4&cat
   =13’); while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?> 
   <span class=”post”> <h2>“><?php the_title(); ?></h2> <div class=”post_content”
   > <?php the_content(); ?> </div> </span><!–End post–> <?php endwhile; ?>
 *  Thread Starter [nesta303](https://wordpress.org/support/users/nesta303/)
 * (@nesta303)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778213)
 * thanks anyway!
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778219)
 * as the problem is not solved – (you wouldn’t be asking in a differnt forum, otherwise)
   some more questions:
 * – have you tried to check each single post if they show properly?
 * – can you copy the rendered html code of the output of that code from your local
   browser and paste it into a pastebin?
 * – can you possibly provide a screenshot of the problem?
 * there is nothing in the code of the template which would suggest that some posts
   should show different, and there should be problems with the layout.
 *  Thread Starter [nesta303](https://wordpress.org/support/users/nesta303/)
 * (@nesta303)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778220)
 * sadly that is true. i was sure i cracked it….
 * how can i copy the html?
 * i’m working with chrome
 *  Thread Starter [nesta303](https://wordpress.org/support/users/nesta303/)
 * (@nesta303)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778222)
 * well heres the screenshot: [http://s1102.photobucket.com/albums/g451/nesta303/?action=view&current=screenshot.jpg](http://s1102.photobucket.com/albums/g451/nesta303/?action=view&current=screenshot.jpg)
 * i thought i solved it by using WP_query:
 * [http://pastebin.com/4gYw8RJu](http://pastebin.com/4gYw8RJu)
 * thanks,
 * Isaac
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778224)
 * > how can i copy the html?
   > i’m working with chrome
 *  – right-click: ‘view page source’
 * have you checked the single posts?
    are they all displaying properly?
 *  Thread Starter [nesta303](https://wordpress.org/support/users/nesta303/)
 * (@nesta303)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778225)
 * here’s the html
 * [http://pastebin.com/pkXtQx2A](http://pastebin.com/pkXtQx2A)
 * i havent checked the singles yet
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778227)
 * there is a variation in the posts how the css class is used in the paragraphs,(`
   <p class="post-content">`) and also how the image is within the first paragraph
   with or without text.
 * this could mean that your problem might be partially caused by formatting, which
   is impossible to check for anybody here in the forum without a live link to the
   problem site.
 * _**definitively **_not caused by the code of the query.
 *  Thread Starter [nesta303](https://wordpress.org/support/users/nesta303/)
 * (@nesta303)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778228)
 * thank you for the quick reply!
 * ok so i’m moving the site to a live server.
 *  Thread Starter [nesta303](https://wordpress.org/support/users/nesta303/)
 * (@nesta303)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778232)
 * ok here is the live site:
 * [http://diet.isaacfeldmandesign.com/?cat=3](http://diet.isaacfeldmandesign.com/?cat=3)
 * somehow, the posts aren’t showing at all.
    🙁
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/#post-2778247)
 * unfortunately this is a fundamental formatting problem;
    complicated with the
   fact that the posts’ structure differs, some of the images are together in one
   paragraph with some text, and that one of the texts continues with a linebreak…
   etc further complicated by the use of the same css class `.post_content` for 
   the div and the paragraph;
 * consider to re-work the html and css fot that template.
 * as I see this not as WordPress issue, personally, my replies end here.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/query_posts-problem-2/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/query_posts-problem-2/page/2/?output_format=md)

The topic ‘query_posts problem!’ is closed to new replies.

## Tags

 * ["p tags"](https://wordpress.org/support/topic-tag/p-tags/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * 16 replies
 * 2 participants
 * Last reply from: [nesta303](https://wordpress.org/support/users/nesta303/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/query_posts-problem-2/page/2/#post-2778249)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
