Not displaying related posts

Home Forums Product Support Forums Related Posts Pro for WordPress Support Not displaying related posts

This topic contains 12 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 months, 1 week ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #34391
    anneonsight03
    anneonsight03
    Participant

    Plugin installed and implemented in Divi theme via shortcode in theme builder. However, it doesn’t seem to be pulling any related posts.

    Seems to be functioning ok — when I manually override in an individual post and enter custom content, that works fine and correctly pulls the custom posts or random content as selected on the individual post, so I know the plugin itself is working fine. But it doesn’t seem to pull any *related* posts.

    So something must be wrong with the way I have the filters set up, but I can’t figure out what.

    I only want to use it for regular posts and to prioritize *tags* and then *post content*.

    E.g., this post has *some* tags and *some* content that match other posts, even if there are no exact matches there should be some ‘following’ content matches, right?
    http://beta.westernpriorities.org/center-for-western-priorities-releases-video-ad-spotlighting-opportunities-to-conserve-30-of-americas-lands-and-waters-by-2030/

    Please let me know what I’m doing wrong here, I’ve tried to tweak the settings read through the support forums but I can’t figure it out!

    Thank you, – Anne

    #34406
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you for the details!

    I have made the following adjustments: https://i.imgur.com/Po6QdkA.png
    The articles are lenghty, this should filter some of the less relevant keywords out and display more relevant articles.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #34429
    anneonsight03
    anneonsight03
    Participant

    Weird, I would have thought making those fields more restrictive would show FEWER articles — not sure why making it more restrictive would make things show up where nothing was showing up before?

    In any case, that does seem to be working now.

    If I limit it to items with matching tags, it’s going to try to match ALL of the tags, or ANY ONE of the tags? (I would really prefer it to do the latter — I want it to pull a match if any ONE of the tags match, not to limit only if ALL the tags match — can you let me know how the algorithm is set up or if that’s a setting I’m missing somewhere?)

    Meanwhile, can you help me with another thing — would like to have TAGS and CATEGORIES showing up where related posts are being shown. Seems like I should be able to either add TAGS and CATEGORIES in the Custom Format Options section — just don’t see what exactly the text I would use is. (I tried “{categoryfield}” and “{taxonomyfield}” — not sure if any of those would work here?)

    Or if I could do something similar to this in the functions.php file, that would work, too, I am comfortable editing functions.php and could add hooks like this to get tags and categories and just add them in this way and format them with css.
    https://wp-dreams.com/articles/2013/06/adding-custom-fields-bbpress-topic-form/

    Just want people to be able to see what kind of post they are linking through to when they click on a related item.

    Thanks!

    #34472
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    If I limit it to items with matching tags, it’s going to try to match ALL of the tags, or ANY ONE of the tags? (I would really prefer it to do the latter — I want it to pull a match if any ONE of the tags match, not to limit only if ALL the tags match — can you let me know how the algorithm is set up or if that’s a setting I’m missing somewhere?)

    You can actually change that here: https://i.imgur.com/PR0DRd2.png
    When it is enabled, then all selected taxonomies must have to match exactly.

    Well, unfortuantely there is not option to show the categories or tags in the related posts contents, but might be possible via a custom code within the functions.php file. If you want, you can add temporary FTP access and I will see if there is anything I can do for you.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #34475
    anneonsight03
    anneonsight03
    Participant
    You cannot access this content.
    #34550
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you!

    I have added the following custom code to the functions.php file in your actual theme directory:

    function add_tags_to_rpp($post) {
    	// Tags
    	$tags = get_the_tags($post->id);
    	if ( $tags !== false && count($tags) > 0 ) { 
    		$tags_output = '';
    		$tags = array_map(function($tag){return $tag->name;}, $tags);
    		$tags_output = '<p style="font-size: 11px;"><strong>Tags:</strong> ' . implode(', ', $tags) . '</p>';
    		$post->content = $tags_output . $post->content;
    	}
    	
    	// Categories
    	$tags = get_the_category($post->id);
    	if ( $tags !== false && count($tags) > 0 ) {
    		$tags_output = '';
    		$tags = array_map(function($tag){return $tag->name;}, $tags);
    		$tags_output = '<p style="font-size: 11px;"><strong>Categories:</strong> ' . implode(', ', $tags) . '</p>';
    		$post->content = $tags_output . $post->content;
    	}
    	return $post;
    }
    add_filter( 'rpp_item_after_postprocessing', 'add_tags_to_rpp', 10, 1);

    This will append the categories and tags list to the related posts content, where possible: https://i.imgur.com/khDVBRd.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #34709
    anneonsight03
    anneonsight03
    Participant

    This looks totally great, exactly what I needed, thank you!!

    #35005
    anneonsight03
    anneonsight03
    Participant

    Can you explain why this is not showing the correct related posts? I just want it to show the posts that have matching tags.

    In this case:
    http://beta.westernpriorities.org/issue/protecting-30-percent-of-america-by-2030/
    There are 3 or 4 posts that are tagged “30×30” and only one is showing up in this sidebar.

    This page has “Haaland” and “BLM” tags selected
    http://beta.westernpriorities.org/issue/the-outdoor-recreation-economy/
    But is only showing 1 “Haaland”-tagged, article — not even the 2 articles in the system that are tagged “Haaland” and “BLM”.

    I have been playing with these settings for hours now now and cannot see to make this work!

    This page is using the “Tags for project sidebar” instance. I have it set to “Look for content in same tags only”, but have “should all terms match exactly” to “off”, so I’m not sure why it wouldn’t be showing those other posts with the matching tags.

    #35018
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    On the advanced options, there are two excluded categories: https://i.imgur.com/7uHGTfV.png
    Is it possible, that the items missing are maybe within these categories too?

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #35049
    anneonsight03
    anneonsight03
    Participant

    That was absolutely the solution. THANK YOU, once again you have solved my problem!! I would like to publicly appreciate how helpful you have been — where is it helpful for you to have a positive review posted? Let me know and I will go do that, I really appreciate the support you have given me.

    Another question: it seems the only sorting options, whether or not the filters are active, are by Title and by Relevance. Is there no sort by date (ASC/DESC) option? It’s a little confusing that these are presenting out of date order, since they are articles that are normally in chronological order.

    Thank you again.

    #35059
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You are very welcome, thank you for your kind words! You can leave a rating on the product via your codecanyon downloads page: https://codecanyon.net/downloads

    I’m afraid there is no other sorting option, only the title and the relevance.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #35065
    anneonsight03
    anneonsight03
    Participant

    Is there any way to add that as a feature request, or even to pay you to add that functionality? It is something we could really use for this site, might be willing to pay to get that functionality added, depending on how much that might cost. Please let me know!

    Thanks.

    #35072
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you for your offer, but I’m afraid I can’t do that. Currently it looks like this product is going to be discontinued within a year unfortunately.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.