Home › Forums › Gillion Theme › Related posts
Home › Forums › Gillion Theme › Related posts
I found only on/off option, but nothing more.
How can I choose which posts are in the “Related posts” section?
Hi @awssoft,
I hope you are well today and thank you for your question.
It displays the posts randomly related to the current post category and you can’t control which posts to display there.
If you want to control related posts section then you can disable theme related posts functionality and use the following related posts functionality provided by Jetpack plugin.
https://jetpack.com/support/related-posts/
https://jetpack.com/support/related-posts/customize-related-posts/
Best regards,
Shufflehound team
This plugin uses third party service. It’s not acceptable solution.
We need something simple, but it’s very important to keep theme look.
Is there are any way to keep look of the theme and to get simple functionality e.g.: two additional field on the “Edit blog post” page.
This will be the perfect improvement for this theme
I found this is very inflexible and actually its not possible to get theme to look as in demo.
I found one plugin with excellent manual linking.
https://wordpress.org/plugins/custom-related-posts/
Also I changed part of single.php. Is there possibility to change single.php troughs child theme in order to stay compatible with further updates and how?
This part was changed:
<div>
<div>$relations = CustomRelatedPosts::get()->relations_to( get_the_ID() );</div>
<div>$args = array(</div>
<div> ‘post__in’ => array_keys($relations),</div>
<div> ‘posts_per_page’ => 6,</div>
<div> ‘tax_query’ => array(</div>
<div> array(</div>
<div> ‘taxonomy’ => ‘post_format’,</div>
<div> ‘field’ => ‘slug’,</div>
<div> ‘terms’ => array( ‘post-format-quote’, ‘post-format-link’ ),</div>
<div> ‘operator’ => ‘NOT IN'</div>
<div> )</div>
<div> ),</div>
<div> ‘orderby’ => ‘rand'</div>
<div>);</div>
<div>$query = new WP_Query( $args );</div>
<div>/*if( $query->post_count < 1 ) :</div>
<div> $args = array(</div>
<div> ‘post__not_in’ => array( get_the_ID() ),</div>
<div> ‘posts_per_page’ => 6,</div>
<div> ‘ignore_sticky_posts’ => 1,</div>
<div> ‘orderby’ => ‘rand'</div>
<div> );</div>
<div> $query = new WP_Query( $args );</div>
<div>endif;*/</div>
</div>
Awesome great to see you got that found.
Also I changed part of single.php. Is there possibility to change single.php troughs child theme in order to stay compatible with further updates and how?
Yes just add that changed single.php file in the root directory of your child theme.