Hi,
I would like to know if is possible use the related entries option with tag while I´m using the Advanced Layout Builder.
Best regards.
Hey OnVisible,
The related posts element is designed to show on posts created with the Classic Editor, or default editor, but you can show it on posts created with the Advanced Layout Builder.
First, you need to add “tags” to your post, this is what the element pulls other posts from.
Then, add this code to the end of your functions.php file in Appearance > Editor:
function related_posts_shortcode( $attr ) {
ob_start();
get_template_part( 'includes/related-posts' );
return ob_get_clean();
}
add_shortcode( 'rpost', 'related_posts_shortcode' );
Then add this shortcode in a “code block” element to display the related posts element:
[rpost]
I just tested this with v4.5.6 and it’s still working.
Best regards,
Mike
Thank you very much Mike!
Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon