Forums

Keep one particular post at the top of my home page... (5 posts)

  1. julianj
    Member
    Posted 2 years ago #

    ...while continuing to display all other posts as per usual. I haven't been able to find anything to do this. Just to be clear, I'm not interested in a static home page. I just want one particular post to always be at the top of the page.

  2. Root
    Member
    Posted 2 years ago #

    You can either edit the loop to run twice. Or you can hard code the post and its content into index.php (bad practise). Codex is replete with loop editing voodoo.

  3. moshu
    Member
    Posted 2 years ago #

  4. julianj
    Member
    Posted 2 years ago #

    Thanks, both great suggestions. For now, WP-Sticky is great.

  5. cam_oai
    Member
    Posted 2 years ago #

    use a query and then u don't have to use plugin:
    in the index, put this only

    <?php
    // retrieve one post with an ID of 5
    query_posts('p=5');
    
    global $more;
    // set $more to 0 in order to only get the first part of the post
    $more = 0; 
    
    // the Loop
    while (have_posts()) : the_post();
      // the content of the post
      the_content('Read the full post ยป');
    endwhile;
    ?>

    change p=5 to a specik post id

Topic Closed

This topic has been closed to new replies.

About this Topic