do you mean a ‘related posts’ section at the end of each post content on an index page?
goto dashboard – plugins – editor: select ‘WP Related Posts’
edit wp-relatedposts.php;
find this section:
if(is_single())
{
if( $options['type'] == "Tags" ){
return $content.wp_relatedposts_ontags(&$options);
}
if( $options['type'] == "Category" ){
return $content.wp_relatedposts_oncategory(&$options);
}
}
return $content;
remove the ‘is_single()’ conditional statement, so you are left wiht:
if( $options['type'] == "Tags" ){
return $content.wp_relatedposts_ontags(&$options);
}
if( $options['type'] == "Category" ){
return $content.wp_relatedposts_oncategory(&$options);
}
return $content;
(totally untested – any edits to the plugin will be lost when you update the plugin)
Hi Alchymyth,
thanks for your prompt reply! My section looks like this:
if (is_single()) {
$statistics_enabled = $options[‘ctr_dashboard_enabled’] && $meta[‘blog_id’] && $meta[‘auth_key’];
$remote_recommendations = $meta[‘remote_recommendations’] && $statistics_enabled;
}
Do we have the same plugin?
Best,
Ellen
my suggestion refers to:
WP Related Posts
http://wordpress.org/extend/plugins/wp-related-posts/
please post the download link for your plugin
– have you selected the right plugin from the dropdown near the top right in the dashboard – plugins – editor page ?
Select plugin to edit:
this time it is the file in your used plugin:
wp_related_posts.php
(line 50)
if ($post->post_type === 'post' && (($options["on_single_post"] && is_single()) || (is_feed() && $options["on_rss"]))) {
try and change it to:
if ($post->post_type === 'post' && (($options["on_single_post"] || (is_feed() && $options["on_rss"]))) {
again, totally untested
The plugin crashed.
I`ve installed the linkwithin plugin right now. This always shows the related post.
Thanks for your help!!!
my mistake – removed one bracket too much;
corrected, if you would like to try again:
if ($post->post_type === 'post' && ($options["on_single_post"] || (is_feed() && $options["on_rss"]))) {
if ($post->post_type === ‘post’ && ($options[“on_single_post”] || (is_feed() && $options[“on_rss”]))) {
Put this code in. Plugin crashed again. Are you sure with the brackets?
I am never sure π
double-checked and changed line 50 to:
if ($post->post_type === 'post' && ($options["on_single_post"] || (is_feed() && $options["on_rss"]))) {
full template wp_related_posts.php
http://pastebin.com/3ByiTQbE
just tested in my local test site, and does work for the index page.
might depend on the many settings options of the plugin.
I used the default settings, ansd only unticked ‘Turn statistics on’ snd ‘Promoted Content’
Tried once more. It automatically deactivates the plugin. Maybe other plugins disturb it… I don’t know π
But thank you!!!