Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tips Display Related Posts in WordPress without a Plugin
#1
If you know anything about bounce rate, you are probably already showing related posts in WordPress. Bounce rate essentially represents the percentage of initial visitors to a site who “bounce” away to a different site, rather than continue on to other pages within the same site. This can have a significant impact on your adsense earning. By adding Related posts in WordPress you are killing three birds with one stone. You are decreasing your bounce rate, you are increasing your adsense income, and lastly you are increasing your pageviews. In this article we will show you how you can display related posts in WordPress with and without a plugin.
How to Display Related Posts in WordPress

 Paste the following code in single.php where you want to display related posts

Code:
<?php
//for use in the loop, list 5 post titles related to first tag on current post
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo 'Related Posts';
$first_tag = $tags[0]->term_id;
$args=array(
'tag__in' => array($first_tag),
'post__not_in' => array($post->ID),
'posts_per_page'=>5,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>

<?php
endwhile;
}
wp_reset_query();
}
?>

Also read 
Related Posts with Thumbnails in WordPress without Plugins

Finding it difficulty Using it on some theme drop a comment we will guide you 
To Purchase Credit Click here , For how to make money on Sologet forum Click here . 
There is love in sharing
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  HOW TO Set mp3 tagger for wordpress djdozic 1 72 11-12-2018, 12:01 AM
Last Post: Citytrend007
  How make a wordpress theme responsive Kingsolomon 1 113 11-11-2018, 11:58 PM
Last Post: Citytrend007
  MUST READ How to Create and Manage Ads.txt files in WordPress Kingsolomon 0 65 10-15-2018, 03:38 PM
Last Post: Kingsolomon
  TIPS Related Posts with Thumbnails in WordPress without Plugins Kingsolomon 1 76 10-12-2018, 04:02 PM
Last Post: jaytex
  MUST READ Naijaloaded Wordpress theme Documentation Kingsolomon 3 329 10-10-2018, 06:57 PM
Last Post: djdozic

Forum Jump:


Users browsing this thread:
1 Guest(s)


Users that viewed this thread:
3 User(s) read this thread:
Alhajimalvjr, Elisrichy, 042coded
Display Related Posts in WordPress without a Plugin00