Forums

Change it from POST showing to a PAGE showing (3 posts)

  1. eddyj
    Member
    Posted 2 years ago #

    Hey right now on my homepage footer i have a post showing, using this code

    <?php query_posts('p=x'); while (have_posts()) : the_post(); ?>
        	<h2><?php the_title(); ?></h2>
        	<?php the_content(); ?>
        <?php endwhile; ?>

    the x represents the post number i give it.

    but I dont want it to be a post, i want it to be a page, now im assuming the code would be similar. Can anyone tell me what it would be to make it like this, where i can pick my page by id

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    page_id=x should work according to query_posts Post and Page Parameters.

    Also this should work:

    $args=array(
        'post_type' => 'page',
        'post_status' => 'publish',
        'post__in' => array (7)
        );
    query_posts($args);
  3. eddyj
    Member
    Posted 2 years ago #

    i will give that a go michael thank you

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags