Forums

Loops on pages (2 posts)

  1. masok88
    Member
    Posted 2 years ago #

    Hi,

    I'm using a custom page for the index page of a theme i'm building. Is it possible to place a loop in it? I've done so but it's only looping the page I've assigned it to i.e; home. I've put a loop on the default index page which I want to loop with but it's still only looping the page as the sole item within the loop. How do I specify the loop to target posts rather than pages?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Try:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'post_type' => 'post',
    	'paged' => $paged
    );
    query_posts($args);
    ?>

    http://codex.wordpress.org/Template_Tags/query_posts

Topic Closed

This topic has been closed to new replies.

About this Topic