Tagged: duplicates, filters, related posts
-
AuthorPosts
-
November 9, 2021 at 4:44 pm #1328379
Hi,
in this page (among others)we are using a post slider item to show related post based on a post tag selection.We selected the do not allor duplicates (offset number automatically)
https://nimb.ws/UBVu46But, as you can see, the current post is shown as the first related post.
Can you please assist with this issue?
Thanks!November 11, 2021 at 8:42 pm #1328695Hey,
Thanks for contacting us!
Could you please update the theme to the latest version – https://kriesi.at/documentation/enfold/theme-update/ and check if that helps? If it does not, please try switching to Enfold parent theme temporarily so we can see if it is related to the changes made on child theme :)
Best regards,
YigitNovember 12, 2021 at 9:38 am #1328762Hi Yigit,
thanks for your reply.
I’ve updated to the latest verion 4.8.7.1 and it doesn’t help.
I’ve switched to the parent theme and it doesnt help either.
We are running a staging copy, so you can check it here: https://srgl.it/inorto/coltivare/tecniche-di-coltivazione/coltivare-il-fagiolo-semina-periodo-concimazione-luna-rotazione/Just to be sure, I’ve also deactivated all the other plugin.
So it seems that I’m doing something wrong somwhere.I’d expect not to see the post “Coltivare il fagiolo: semina, concimazione, luna, rotazione e consociazione” in the related posts at the bottom, Is that right?
Hope to hear from you soon.
Thanks!November 15, 2021 at 6:38 am #1329023Hi,
Thank you for the inquiry.
You may need to add this filter in the functions.php file to exclude the current post from the blog posts query.
add_filter("avia_post_slide_query", function($query) { if(is_singular('post')) { $query['post__not_in'] = array(get_the_ID()); } return $query; }, 10, 1);
Best regards,
IsmaelNovember 15, 2021 at 11:43 am #1329069Hi Ismael,
thank you for you reply.I added the code in the parent and in the child theme but in no one of them the trick seems to work.
Can you please assist?
Thanks!November 15, 2021 at 2:01 pm #1329099 -
AuthorPosts
- You must be logged in to reply to this topic.