Create A Latest Post Section At The Beginning Of Each Post
I get this idea from SmashingApps. They created a latest article section at the top of each article. You may refer to the screenshot below:

This will make sure those readers who reach your blog through search engine or referer will have a chance to read the latest article. So, how are you going to add this section? Do you need any plugin to do so? No, you don’t need any plugin to add this section. Simply follow the tutorial below, and i will create a custom function for you.
- First, open your template’s functions.php using any text editor.
- Place this code at the end of the file. (Before “?>“)
/* Get latest post */ function get_latest_post($pre="You maybe interested in our latest article") { global $wpdb; $sql = " SELECT P.ID, P.post_title FROM $wpdb->posts P WHERE P.post_status = 'publish' AND P.post_type = 'post' ORDER BY P.ID DESC LIMIT 1 "; $post = $wpdb->get_row($sql); $ret = $pre; $ret .= '<a href="'. get_permalink($post->ID).'" title="'. $post->post_title .'"> '. $post->post_title .'</a>'; echo $ret; } - Basically, the code will query the latest published post, get the permalink and post title, and then append it with some text (the default is “You maybe interested in our latest article“).
- Open your single.php and place this code before the “entry” div.
<div id="latest-post"> <p><?php get_latest_post("You may want to read our latest article"); ?></p> </div> - You may change the “You may want to read our latest article” to any text that you want. Leave it blank and you will use the default setting.
You may call this function anywhere in your article or change the style through your template’s stylesheet.