WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multi-loop ? using two loops ? calling specific page outside the loop (3 posts)

  1. krembo99
    Member
    Posted 6 years ago #

    Hello all.
    I am designing a new and unique template ,horizontal, mainly for portfolios.
    in my template I use table tags (the only way i could though of )
    My problem is as followed :
    I need the FIRST table cullom to get only 1 specific post (about page) where all the others to get all the posts (normal loop)
    Normally the template works great, and fils the table cells exactly with the info i need, but when I try to fill the first collum with the "about" page, the loop stops working ,showing only the "about" entry twice.

    to put the "about" page on the first column i have used this inside a tr tag:

    <?php query_posts('pagename=about'); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php the_content(); ?>
    <?php endwhile; ?>
    <?php endif; ?>

    after which I have tried to put the other classic loop
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    .........

    <?php endwhile; else: ?>
    <p><?php _e('Sorry, there aren\'t any posts that match what you requested.'); ?></p>
    <?php endif; ?>

    and so on, to fill the other cells.

    Is there another way to call a specific page to be used outside the loop ?

  2. krembo99
    Member
    Posted 6 years ago #

    ok..
    I have solved it myself ..
    Just had to add anther query in front of the second loop

    <?php
    query_posts('showposts=999');
    ?>

    well.. at least this post might help someone else :-)

  3. Zhen
    Member
    Posted 5 years ago #

    Thanks krembo99!! Im working on a theme too (my first theme, for my own site) but started learning CSS only two weeks ago and have little knowledge about PHP. I also use two loops to display featured posts and normal posts, and this does help me out!! Thank you very much! & drop by my site at http://theakiba.com if you like. The theme is still on process, probably done before X'max.

Topic Closed

This topic has been closed to new replies.

About this Topic