WordPress post related hacks to improve your template
Posted in Development by Alex | Tags: hacks, post, WordpressIn this article you will find various ways of improving your theme by adding various wordpress post hacks like showing related posts, setting up and showing scheduled posts or showing a featured post. All of these hacks can optimize your wordpress blog by increasing time on site, bounce rate and other SEO issues.
How to show related posts based on keywords
First up Download, install, and activate the “Ultimate Tag Warrior fin” plugin. After this open up your single.php and before the comments template:
<?php comments_template(); ?>
insert this code snippet:
<div class="relatedposts"> <h2>Related Posts</h2> <?php UTW_ShowRelatedPostsForCurrentPost("posthtmllist", "", "4"); ?> </div></php>
You can set up the number of related posts by increasing the number “4″. Save the single.php and refresh your website. The posts will be shown based on the related keywords other posts have. You can also further stylize your snippet by creating a class entry “relatedposts” inside your style.css file.
How to list scheduled posts
Sometimes, you schedule posts instead of stuffing them all together at one time. This can be useful if you have much to write about and if you want to let your readers know what to expect for the future. This encourages the reader to visit you again and read that great post you scheduled for another day.
Ok, this snippet is easy to install, just paste the following code anywhere inside your theme files that you want the scheduled post to appear:
<?php $my_query = new WP_Query('post_status=future&order=DESC&showposts=5'); if ($my_query->have_posts()) { while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <li><?php the_title(); ?></li> <?php endwhile; } ?>
How to show a random featured post
This hack is useful for a number of reasons like SEO optimization, reader engagement, low bounce rate or having something to show-off. And here is how you can do it:
First you need to download this plugin, install and activate it.
Next thing is to open up your index.php file, and right after this tag
<?php if (have_posts()) : ?>
insert this tag
<?php show_featured_post(); ?>
You can customize this further by wrapping the tag within a css style like this:
<div style="padding:10px; border:5px solid #ccc; margin-top:10px;"> <?php show_featured_post(); ?> </div>
You may be interested in these also:
One Comment to “WordPress post related hacks to improve your template”
Post comment
Sponsors
Pages
Recent Posts
- 35+ free Icon sets for your next web development project
- Grunge web design tools, brushes and patterns
- Rushhour: WordPress Corporate business blog template
- Autor comment highlight in WordPress 2.8+
- How to create a peel ad in a WordPress blog
- How to make a author box in WordPress
- Best 5 wordpress hosting providers
- A free Photoshop WordPress theme
- 15+ Internet Explorer comics
- How to debug for IE6 with multiple IE instances
- 20+ deviant inspirational design layouts
- How to make your very own CAPTCHA
- 25+ incredible Photoshop makeover videos
- 10 best of the best Joomla themes
- How to set up a hotel reservation form in a WordPress page
Wordpress post related hacks to improve your template | Design strike | wpden says:
[...] some-more here: WordPress post associated hacks to urge your template | Design strike Related Posts:Top Most Wanted WordPress Hacks – Themeflash : One Stop For All …9 Hacks para [...]