WordPress.org

Ready to get started?Download WordPress

Forums

Point to single post (3 posts)

  1. Konzine
    Member
    Posted 6 years ago #

    Hello,

    I am currently designing my theme, and in my theme I was wondering if there is any way to call a specific post, with the post id number possibly, to show the excerpt on my static page. So, basically, I was to have a small 250x250 box on my left column, with 1 single post that will forever be in that box. Is there a way to call a specific post in such a way?

    Thanks!

  2. Kalessin
    Member
    Posted 6 years ago #

    Yes, there is. You run another instance of the WordPress Loop, specifying the ID of the Page you want to display (in the example below, it's ID 23):

    <?php
    query_posts('page_id=23');
    while ( have_posts() )
    {
    	the_post(); ?>
    	<h3><?php the_title(); ?></h3>
    	<?php the_content(); ?>
    	<?php edit_post_link(__('<p>(edit)</p>'));
    }
    ?>
  3. Konzine
    Member
    Posted 6 years ago #

    You rock!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.