genesis theme development

How to show related post without plugin in genesis theme ( 2018 updated )

How to show related post without plugin in word press or genesis theme. Top 3 cool idea to add related post in word press. Many user want to add related post in word press but don’t like to use plugin ad it increase number of request, also reduce site loading speed. With this we can also customize look like show related post without thumbnail. Let’s know about something more interesting about genesis theme design and importance of related post in a blog post. How to show related post without plugin in genesis theme & benefit of adding related post without plugin. We also look at easy customization of related post.

show related post without plugin in genesis theme

Adding related post in word press blog or genesis theme can be done by with or without plugin. Some user want to add plugin as it is easy and customization if they don’t have any idea how to customize blog related post design but some want to avoid the use of plugin as they increase site loading time. Here is top idea to add related post in word press blog plugin or without plugin. If you are looking to Show related post without plugin in genesis theme first know about some benefit of related post in word press blog.

Benefit of adding related post:

It contain automatic selection of related post which is currently reader read also he can look up at some more post if he had interest in the topic of your blog. Show related post without plugin in genesis theme has also many other advantage like.

1.) Improve user experience:

Best way to find relevant article to reader and he can read more about the topic. If you use image of article with related post user may like it.

2.) Improve seo:

Important part of SEO is interlinking and related post can improve serp and search engine result for your blog.

3.) Lower bounce rate:

It lower the bounce rate because reader spend more time on blog. If your article are related to a reader’s interest he can’t leave your blog quickly. Let’s know some more about top 3 method of adding related post in genesis theme or word press blog also how to show related post without plugin in genesis theme

Top 3 method of add related post widget.

There are 3 cool method of using plugin and show related post in word press or genesis theme blog. First is third party plugin, second is jet pack that is called bunch of plugin, and third is without plugin and customization of related post. You can also control the numbers of Show related post without plugin in genesis theme by editing plugin or php code below.

With plugin:

If you are beginner it is best way to show related post by a third party plugin. In word press blog jetpack also offer us to show related post and second third party plugin. With these plugin if you have no idea about php, html and css you can easily change look and display of related post. But using plugin may increase your site loading time.

show related post without plugin in genesis theme

It’s a really cool idea to show related post without plugin in genesis theme because it improve your site loading speed and time and it is fully customization. Adding code without plugin you must follow 3 steps.

  • First backup your blog.
  • Have some idea how to implement php code.
  • Have access c panel and some knowledge how to correct the error happen while editing blog coding.

Advantage / benefit of adding code without plugin:

  • Optimize speed of word press blog
  • Don’t send extra request of plugin.

Add related post below post without any plugin part-1

To add related post below post add below php code in your function.php

First go to admin panel >> appearance >> editor >> function.php  and paste below code.

add_action(‘genesis_before_comments’, ‘custom_post_navigation’);function related_posts_categories() {if ( is_single ( ) ) {

global $post;

$count = 0;

$postIDs = array( $post->ID );

$related = ”;

$cats = wp_get_post_categories( $post->ID );

$catIDs = array( );{

foreach ( $cats as $cat ) {

$catIDs[] = $cat;

}

$args = array(

‘category__in’ => $catIDs,

‘post__not_in’ => $postIDs,

‘showposts’ => 3,

‘ignore_sticky_posts’ => 1,

‘orderby’ => ‘rand’,

‘tax_query’ => array(

array(

‘taxonomy’ => ‘post_format’,

‘field’ => ‘slug’,

‘terms’ => array(

‘post-format-link’,

‘post-format-status’,

‘post-format-aside’,

‘post-format-quote’ ),

‘operator’ => ‘NOT IN’

)

)

);

$tag_query = new WP_Query( $args );

if ( $tag_query->have_posts() ) {

while ( $tag_query->have_posts() ) {

$tag_query->the_post();

$img = genesis_get_image() ? genesis_get_image( array( ‘size’ => ‘related’ ) ) : ‘<img src=”‘ . get_bloginfo( ‘stylesheet_directory’ ) . ‘/images/related.png” alt=”‘ . get_the_title() . ‘” />’;

$related .= ‘<li><a href=”‘ . get_permalink() . ‘” rel=”bookmark” title=”Permanent Link to’ . get_the_title() . ‘”>’ . $img . get_the_title() . ‘</a></li>’;

$postIDs[] = $post->ID;

$count++;

}

}

}

if ( $related ) {

printf( ‘<div class=”related-posts”><h3 class=”related-title”>Must read also</h3><ul class=”related-list”>%s</ul></div>’, $related );

}

wp_reset_query();

}

}

add_action( ‘genesis_before_comments’, ‘related_posts_categories’ );

show related post without plugin in genesis theme : Second part

Add below css in your style sheet code.

Go to appetence than style.css and paste the code.

/*———————————–related-post——————————–*/
.related-posts {padding-top:10px;padding-left:30px;font-size: 15px;border: 1px solid #ccc;overflow: hidden;margin: 0 0 10px; 

}

.related-list li {

margin-right:20px;

float: left;

text-align:center;

width: 30%;

 

margin-bottom:20px;

}

.related-list img {

height:100px;

 

display: inline;

margin: 0 auto;

 

}

Quick change option.

if you Want to change height and width of image

Change 32% to px for example want to display 250px photo change code to 250px;

Height can be changed according to desired panel.

Want to change look in mobile

Look up at you theme’s mobile code look like below;

@media only screen and (max-width: 480px)

Paste css again in the above line. And click save.

Final word

How to add related post without plugin in genesis theme or word press is great idea to increase blog loading speed, reduce bounce rate and make your blog seo friendly. if you Have any question about show related post without plugin in genesis theme and genesis theme development or want to design a word press genesis theme design blog contact us.

Subscribe to our mailing list

* indicates required

Leave a Reply

Your email address will not be published. Required fields are marked *