Hi,
Not sure what you mean as the actual version of the theme related posts system is based on taxonomies: http://screencast.com/t/XljCStnKsX and to change it you’d need custom mortification to the theme for which you need custom work. Sorry!
Thanks for the message!
-
This reply was modified 11 years by
Lucian.
Hi Lucian,
i want to disabled related post system from the theme,
we want to disply the related posts using the widget we have already available in the sideabar ..http://i60.tinypic.com/fjqq2s.jpg
can you provide the short code to display the content in place of related posts http://i62.tinypic.com/k71ab.jpg
Thanks
-
This reply was modified 11 years by
srikanth.
Hi,
First you have to disable the Related Articles from Theme Panel – http://screencast.com/t/SxkPbkvIysgA
Then use the do_shortcode() function to call the plugin shortcode on the desired location inside the post template files – http://screencast.com/t/oOBXd4Rp31 – https://developer.wordpress.org/reference/functions/do_shortcode/
Check the plugin documentation to find it’s shortcode.
Thank you!
Thanks for the reply.. i found the following information from the plugin author …
Add related posts automatically after the post content by using a code snippet in your (child) theme’s functions.php file
add_filter( ‘the_content’, ‘add_related_posts_after_post_content’ );
function add_related_posts_after_post_content( $content ) {//check if it’s a single post page.
if ( is_single() ) {// check if we’re inside the main loop
if ( in_the_loop() && is_main_query() ) {// add your own attributes here (between the brackets [ … ])
$shortcode = ‘[related_posts_by_tax posts_per_page=”4″]’;// add the shortcode after the content
$content = $content . $shortcode;
}
}return $content;
}
in our theme,can we put the code in the function.php directly ??
Hi,
Yes, you can place it at the end of the functions.php file.
The shortcode is – http://screencast.com/t/ywl8VeRS
Make sure that the double quotes and the other signs are similar to the default ones, if possible use a code editor like Notepad++. If you decide for different position the do_shortcode() line should look like this:
<?php echo do_shortcode('[related_posts_by_tax posts_per_page="4"]'); ?>
Thank you!
-
This reply was modified 11 years by
Emil G.