Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1097195

    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.

    #1097318

    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

    #1101002

    Thank you very much Mike!

    #1101044

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Related entries with Advanced Layout Builder’ is closed to new replies.