Techniques To Display Featured Articles in WordPress Blog Using Simple Sticky Post
Simple sticky post is the simplest way to display featured articles in your blog. Typical way for the new bloggers, yet it is easy, simple and effective.
With this method, you can show (simple image, post title and post excerpt) from the selected category. Example as below.
So how can we display this simple sticky post in our theme?
Follow these simple steps:
To show featured post only in the home page, you can use the code below.
<?php if(is_home() !is_paged()): ?>
<?php // Featured posts go here.
include (TEMPLATEPATH . "/featured.php"); ?>
<?php endif;?>Adding the new template where we can call the feature post from. Simply add the new template to your wordpress directory under the name ( featured.php ). This file will contain the featured post elements (Numbers, Category, Style, etc..).
To add the code that shows the featured post content (featured post image – featured post title – excerpt – and the featured category). Look at the example code below.
<!– start Featured –>
<?php query_posts("showposts=1&cat=6"); ?>
<?php while (have_posts()) : the_post(); ?>
<div id="featured">
<div id="featured2">
<div id="featurediv">
<div>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Continue reading <?php the_title(); ?>"><img src="<?php $values = get_post_custom_values("Thumbnail"); echo $values[0]; ?>" alt="Continue reading <?php the_title(); ?>" /></a>
</div>
<div>
<div>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Continue reading <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div><?php edit_post_link(‘Edit’, ”, ‘ |’); ?> Posted by <strong><?php the_author(); ?></strong> on <?php the_time(‘d M Y’); ?> under <?php the_category(‘, ‘) ?> | <?php comments_popup_link(’0 Comments’, ’1 Comment’, ‘% Comments’); ?>
</div>
</div>
<div>
<?php the_excerpt(); ?>
</div>
</div>
<div></div>
</div>
</div>
</div>
<?php endwhile; ?><!– end Featured –>You can change the number of sticky posts or featured posts from the code above, Also you can select the category where you can call posts from.
I would consider this the simplest way to show Featured article in WordPress blog.





