WordPress.org

Ready to get started?Download WordPress

Forums

query_posts problem! (17 posts)

  1. nesta303
    Member
    Posted 2 years ago #

    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]

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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.

  3. nesta303
    Member
    Posted 2 years ago #

    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?

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    can i paste the output html or the php file itself somewhere?

    you can paste any code using the http://pastebin.com/ -
    instructions are in here: http://codex.wordpress.org/Forum_Welcome#Posting_Code

  5. nesta303
    Member
    Posted 2 years ago #

    OK so heres the entire category page pastebin link

  6. nesta303
    Member
    Posted 2 years ago #

    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; ?>

  7. nesta303
    Member
    Posted 2 years ago #

    thanks anyway!

  8. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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.

  9. nesta303
    Member
    Posted 2 years ago #

    sadly that is true. i was sure i cracked it....

    how can i copy the html?

    i'm working with chrome

  10. nesta303
    Member
    Posted 2 years ago #

    well heres the screenshot: 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

    thanks,

    Isaac

  11. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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?

  12. nesta303
    Member
    Posted 2 years ago #

    here's the html

    http://pastebin.com/pkXtQx2A

    i havent checked the singles yet

  13. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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.

  14. nesta303
    Member
    Posted 2 years ago #

    thank you for the quick reply!

    ok so i'm moving the site to a live server.

  15. nesta303
    Member
    Posted 2 years ago #

    ok here is the live site:

    http://diet.isaacfeldmandesign.com/?cat=3

    somehow, the posts aren't showing at all.
    :(

  16. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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.

  17. nesta303
    Member
    Posted 2 years ago #

    thank you for the feedback.

Topic Closed

This topic has been closed to new replies.

About this Topic