WordPress.org

Ready to get started?Download WordPress

Forums

What is the equivalent of the_post() for page? (4 posts)

  1. wrip
    Member
    Posted 1 year ago #

    I want to display pages instead of posts something like below:

    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>

    How do I achieve this?

  2. IMICreation
    Member
    Posted 1 year ago #

    you have to run query posts for this
    <?php query_posts(array('post_type'=>'page')); ?>
    than your loop

  3. wrip
    Member
    Posted 1 year ago #

    great. thanks!

  4. Andrew Bartel
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags