Plugin Author
Ajay
(@ajay)
You won’t be able to do this automatically, because even with the cache, this will clear at regular internals.
You can however do this manually. If you’ve got the related posts, you can edit the post and fill in the ids in the Contextual Related Posts meta box at the bottom under Manual Posts
Hello,
I have selected multiple content items (e.g. pages, posts, glossary) to be included within the contextual related post’s settings. As far as the selection of the items to be shown is concerned, I have manually entered within every content item the IDs of the other related items and I set up the plugin to show 3 items using a RANDOM selection.
Unfortunately, the plugin does not select in random but rather displays every content item individually.
If, for example, I input the IDs 751,251,333 (pages) and 222,153,211 (glossary) to the manual CRP IDs for a post, when I view the post at the frontent the plugin ALWAYS displays 751,251,333 as related posts (i.e. all the pages) and does not display anything from the glossary items. If now I enter only two IDs from the pages content item to CRP manual IDs, e.g. 751, 251, then the CRP plugin at the frontend does show these two ALWAYS and then the first glossary item (222). In other words, the plugin displays the related post IDs using the exact order that their IDs were entered within the respective per-item field, despite the fact that within the “List Tuning” tab in the plugin settings Order Posts has been set to Random and Randomize Posts is also checked.
How can we randomly display related posts per item using the manually entered IDs?
Thank you!
Plugin Author
Ajay
(@ajay)
Thanks for the detailed explanation, the reason for this is because the random sorting is done before the manual posts are included.
I don’t know if this snippet will work, but you might need to include into functions.php of your theme.
https://github.com/WebberZone/code-library/blob/master/contextual-related-posts/crp-random-posts.php
Please backup before trying.
Hello,
Thank you for the prompt response. After some testing, it seems to work!
Keep up the good work!
Plugin Author
Ajay
(@ajay)
Glad to know that. Please do consider a review