• Hi,
    I use the Wp related posts plugin. It works fine, but there is just one thing, that I don’t like on this plugin. The readers only see the related posts, when the click directly to the articels.
    But I want to have it always visible when someone is scrolling over my startpage, reading the last 3 articels, without clicking the particular posts. I think this will bring a lot more of traffic.

    http://www.friedatheres.com/

    Thank you! Regards from Germany!

    Ellen

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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)

    Thread Starter Ellen_81

    (@ellen_81)

    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:

    Thread Starter Ellen_81

    (@ellen_81)

    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

    Thread Starter Ellen_81

    (@ellen_81)

    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"]))) {
    Thread Starter Ellen_81

    (@ellen_81)

    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’

    Thread Starter Ellen_81

    (@ellen_81)

    Tried once more. It automatically deactivates the plugin. Maybe other plugins disturb it… I don’t know πŸ™‚

    But thank you!!!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘WP related post always visible’ is closed to new replies.