-
AuthorPosts
-
September 14, 2021 at 5:10 pm #1320938
I’ve scoured the forums and Google results but haven’t been able to figure out how to show related posts.
There are some posts saying there’s an add-on/plugin with a Github link that resolves in 404.
Other posts are saying it needs to be activated in the Theme Options > Blog Layout > Related Posts — but I don’t have any option there that looks at all related.
Some posts show screenshots of a layout element for Related Posts. Again, no such element in my builder.Use case specifics:
I have a custom post type and taxonomy (both created with Pods). Layout builder works just fine and everything renders as expected.
There are ~30 posts, all tagged. I would like to show the top related posts at the bottom of the page.Thanks for your help. Happy to supply login info if needed.
September 15, 2021 at 1:04 pm #1321031Hey SpeedofLike,
Thank you for the inquiry.
Looks like you are using the Advance Layout Builder (ALB) to create the content of the posts. You may have to use any of the posts elements (blog posts, magazine, post slider) and add it to the post to create a related posts section. However, if you would like to automatically add a related post section for post created using the ALB, please try this snippet in the functions.php file.
function avia_add_social_toolbar_template_builder($content = "") { if (!is_singular("post")) return $content; ob_start(); get_template_part( 'includes/related-posts' ); $related = ob_get_clean(); $content .= $related; $content .= ''; return $content; } add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1);
Best regards,
IsmaelSeptember 23, 2021 at 7:51 pm #1322070Thanks for the reply, Ismael.
I tried inserting your snippet in my functions.php and it removed all my page content on the front end (every page became just the menu and footer), so that didn’t work :).
Any other ideas? I thought there was a module in ALB for related posts, or a toggle somewhere to do it automatically.
Also, to clarify, I want to be able to call it on some custom post types, not necessarily all posts on the site.
September 24, 2021 at 12:12 pm #1322194 -
AuthorPosts
- You must be logged in to reply to this topic.