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 1 year, 5 months ago.
- AuthorPosts
- August 27, 2021 at 9:13 pm #34391
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
August 30, 2021 at 9:34 am #34406Hi,
Thank you for the details!
I have made the following adjustments: https://i.imgur.com/Po6QdkA.png
Best,
The articles are lenghty, this should filter some of the less relevant keywords out and display more relevant articles.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
August 31, 2021 at 1:12 am #34429Weird, 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!
September 1, 2021 at 2:39 pm #34472If 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 :)
September 1, 2021 at 3:29 pm #34475You cannot access this content.September 6, 2021 at 11:53 am #34550Thank 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 :)
September 13, 2021 at 8:57 pm #34709This looks totally great, exactly what I needed, thank you!!
-
This reply was modified 1 year, 6 months ago by
anneonsight03.
October 5, 2021 at 4:19 am #35005Can 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.
October 5, 2021 at 2:15 pm #35018Hi!
On the advanced options, there are two excluded categories: https://i.imgur.com/7uHGTfV.png
Best,
Is it possible, that the items missing are maybe within these categories too?
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 7, 2021 at 12:42 am #35049That 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.
October 7, 2021 at 2:15 pm #35059You 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 :)
October 7, 2021 at 5:19 pm #35065Is 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.
October 8, 2021 at 6:23 am #35072Thank 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 :)
-
This reply was modified 1 year, 6 months ago by
- AuthorPosts
You must be logged in to reply to this topic.