• Resolved tspack

    (@tspack)


    I want my site to have pages rather than posts on the home page. I know I need I something like ‘post_type’ => ‘page’ somewhere in the code below, but I keep getting errors when I stick it in, so I’m obviously doing it wrong.

    In addition, is it possible to have it pull in parent pages only? If so, how would I do that?

    Thanks.

    <?php $args=array(
    		'showposts' => get_option('magnificent_homepage_posts'),
    		'paged' => $paged,
    		'category__not_in' => get_option('magnificent_exlcats_recent')
    	);
    	query_posts($args); ?>
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<?php if (!$blogStyle) include(TEMPLATEPATH . '/includes/entry.php');
    		else include(TEMPLATEPATH . '/includes/entry-blogstyle.php'); ?>
    	<?php endwhile; ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    $args=array(
    	'posts_per_page' => get_option('magnificent_homepage_posts'),
    	'paged' => $paged,
    	'post_type' => 'page',
    	'category__not_in' => get_option('magnificent_exlcats_recent')
    );
    Thread Starter tspack

    (@tspack)

    That worked! Thank you!!!!

    Is it possible to have it pull in parent pages only, not child pages?

    esmi

    (@esmi)

    Try:

    <?php  $args=array(
    	'posts_per_page' => get_option('magnificent_homepage_posts'),
    	'paged' => $paged,
    	'post_type' => 'page',
    	'category__not_in' => get_option('magnificent_exlcats_recent')
    );
    query_posts($args);
    if (have_posts()) : while (have_posts()) : the_post();
    if( $post->post_parent ) continue;
    elseif (!$blogStyle) include( get_template_directory() . '/includes/entry.php');
    else include(get_template_directory() . '/includes/entry-blogstyle.php'); ?>
    endwhile; ?>
    Thread Starter tspack

    (@tspack)

    That works! Thank you!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Top level pages in place of posts’ is closed to new replies.