Use a loop like:
<?php
$args=array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 1,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo 'Featured Post';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>
Thread Starter
Jam
(@pimaniii)
Hmm… Where should I place that? I tried putting it in page.php and replacing it with
if (have_posts()):
while (have_posts()):
the_post();
mystique_page();
endwhile;
But nothing changed.
Thread Starter
Jam
(@pimaniii)
Ok, I placed it in Index.php and it worked.
However, that code only displays a link to the post.
Is there any way I can display the entire/part of the post, and have it identify as a feature post? Also, I am using Mistique, so how can I make it look like the other posts? I know this is a specific question, so if someone could point me in the right direction that would be great!
Specific code is nicer! =]
Thanks
Put the template tag, the_content(), or [Template_Tags/the_excerpt|the_excerpt()]], just before the endwhile.
Related:
Stepping Into Template Tags
Stepping Into Templates
Template Hierarchy