Select Menu
  • Home
  • Wordpress
  • Blogspot
  • SEO
  • Online Earning
  • About Us
  • Contact Us
  • Sitemap
  • PrivacyPolicy
  • About Us
  • Contact Us
  • Sitemap
  • Privacy Policy
Pressspot - Wordpress, Blogspot Coding And SEO Tutorial
  • Home
  • Wordpress
  • Blogspot
  • SEO
  • Earning
Home wordpress Show related post in your wordpress with thumbnail without any plugins!

Friday, 30 March 2018

সিহাব সুমন

Show related post in your wordpress with thumbnail without any plugins!

  সিহাব সুমন      Friday, 30 March 2018     wordpress      1 comment   
Related post is very useful for a blog for show related article to visitors. for show related post there are huse of plugins for free. but use of plugins is not good for a wordpress blog. it is the main cause of delayed loading time for wordpress. if you want to display related post without any kinds of plugins in your wordpress blog. then you can follow my post carefully.
1. First of all copy this code:
<div class="relatedbox">
<h2> Related Post </h2>
<ul class="rpul">
<?php
$category = get_the_category($post->ID);
$current_post = $post->ID;
$posts = get_posts('numberposts=5&category=' . $category[0]->cat_ID . '&exclude=' . $current_post);
foreach($posts as $post) : setup_postdata( $post ); ?>
 <li>
<?php if ( has_post_thumbnail() ) { the_post_thumbnail('portfolio'); } else { ?> <img src="<?php bloginfo('template_directory'); ?>/images/default.gif" /> <?php } ?> 
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>    
<br/>
<font color="green">Tuner:</font><font color="red"> <?php the_author();?> &nbsp;</font>
<span>
<span>
       <?php the_date('j F, Y');?>
        </span>
 <span>
        <?php comments_popup_link ('Leave a comment' , '1 comment' , '% comments'); ?>
        </span> 
&nbsp;

<?php
          echo getCrunchifyPostViews(get_the_ID());
?>
</span>
</li>
<?php endforeach; wp_reset_postdata();?> 
</ul>
</div> <!--relbox-->
IF PROBLEM COPY HERE
now paste and save it in your themes 'single.php' files which location where you can show your related post(at the end of all post).2. now copy this code:
.relatedbox {
padding-top: 10px;
padding-left: 10px;
border: 1px solid #bbbdde;
border-radius:.1em 0 0 0;
margin-bottom: 10px;
}
.rpul {}
ul.rpul li{padding: 5px; border-bottom: 1px solid #ddd; display: block; min-height: 80px;}
ul.rpul li:last-child{padding: 5px; border-bottom: 0px}
ul.rpul img{float: left; padding: 5px; border: 1px solid #bbbdde; 
border-radius:.1em 0 0 0;
margin-right: 5px; width: 60px; height: 60px;}
ul.rpul p{ display: block; font-size: 13px}
ul.rpul p a{display: inline-block; font-size: 13px; color: #000}
ul.rpul a{font-size: 15px;}

IF PROBLEM COPY HERE
paste and save it in your themes 'style.css' file.
3. now load a single post and see that, your related post is displaying after single post with thumbnail like this:
So, enjoy yourself. thanks.


Share This Post
Tweet Share Share Share Share Share

1 comment:

  1. সিহাব সুমন3 April 2018 at 22:23

    (f)

    ReplyDelete
    Replies
      Reply
Add comment
Load more...

Comments here

Popular Posts

  • How to add autoplay background music on blogger blog.
    We know that blogger or blogspot is a favorite blogging platform for all of bloggers. it is easy to use and free platform. one can easily ...
  • Do you know? how to stop all external request on your wordpress blog?
    At first take my salam, hope all of you are very fine. i am also. wordpress is a number one blogging platform. it is easy to use and manag...
  • If your wordpress theme doesn't support 'Menu' you can try this post for 'Menu' support.
    some low quality wordpress theme doesn't support menu. or when a wordpress theme maker create new custom theme then need menu support...
  • Hide 'Screen Option' tab from your wordpress dashboard with some coding !!!
    Hope all of you are very fine. when we visit our wordpress dashboard then we see a tab menu on lef side corner which is named 'Screen O...
  • Wordpress file upload button or 'add media' button not working? this is the solution!!
    How are you? wish all of you are very fine. im also fine. you know that i always share without plugin post. today i am sharing a nice code ...
  • How to change default footer text from wordpress dashboard.
    When we enter our wordpress sites dashboard then we see some default text and link like this: which is wordpress related. however, if y...
  • Remove wordpress logo from admin bar!
    When we visit our wordpress sites admin panel in dashboard. then we see a wordpress logo like this: Which is containing a wordpress logo...
  • how to change the permalink in wordpress without plugins ?
    how to change the permalink in wordpress Generally we set wordpress permalink from setting option. but if you try you can set permal...
  • Stop dragging effect for wordpress metabox without any kinds of plugins!!
    At first take my salam. hope all of you are very fine. when we visit our wordpress sites dashboard, then we see some meta box and if you wa...
  • MS Word 2007 to PDF Convert - Bangla Turorial-2022

Contact Form

Name

Email *

Message *

Subscribe to our email newsletter & receive updates right in your inbox.

Blog Archive

Popular Posts

  • How to add autoplay background music on blogger blog.
    We know that blogger or blogspot is a favorite blogging platform for all of bloggers. it is easy to use and free platform. one can easily ...
  • Do you know? how to stop all external request on your wordpress blog?
    At first take my salam, hope all of you are very fine. i am also. wordpress is a number one blogging platform. it is easy to use and manag...
  • If your wordpress theme doesn't support 'Menu' you can try this post for 'Menu' support.
    some low quality wordpress theme doesn't support menu. or when a wordpress theme maker create new custom theme then need menu support...
  • Hide 'Screen Option' tab from your wordpress dashboard with some coding !!!
    Hope all of you are very fine. when we visit our wordpress dashboard then we see a tab menu on lef side corner which is named 'Screen O...
  • Wordpress file upload button or 'add media' button not working? this is the solution!!
    How are you? wish all of you are very fine. im also fine. you know that i always share without plugin post. today i am sharing a nice code ...
click here

Labels

blogspot (1) wordpress (27)

Facebook Fan

BANNER 728X90

মোট পৃষ্ঠাদর্শন

Sparkline

আমার সম্পর্কে

  • সিহাব সুমন
  • itbatayan

Responsive Ads

Responsive Ads Here
Powered by: Blogger
Sitemap | Terms Condition |
Copyright © Pressspot - Wordpress, Blogspot Coding And SEO Tutorial