Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #1305128

    Enfold team, hello.
    Here’s an interesting twist. Would it be possible to display the “You Might Also Like” related content in the sidebar as a widget rather than at the bottom of a post?

    Thanks for your insight.


    Hey Julie,
    Thank you for your patience, unfortunately, you can not do this typically, but you could try this with a custom shortcode and some custom CSS. First, try adding this code to the end of your functions.php file in Appearance > Editor:

    function related_posts_shortcode( $attr ) {
        get_template_part( 'includes/related-posts' );
        return ob_get_clean();
    add_shortcode( 'rpost', 'related_posts_shortcode' );

    I recommend using a child theme
    Then add a Custom HTML widget to your sidebar and use this shortcode: [rpost]
    Then add this css to your child theme stylesheet, or theme Quick CSS area:

    .widget_custom_html > .custom-html-widget > .related_posts {
    	padding: 23px 0 0 0;
    #top .widget_custom_html > .custom-html-widget > .related_posts > .related_entries_container > .related_column {
        width: 100%;
    #top main > .related_posts {
    	display: none;

    Please note that the last rule is to hide the regular related posts element from your posts.
    Expected results:

    Best regards,

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.