Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #438830

    I want to have related posts show up on blog posts using tags. I can see the post “Enfold: Using CPT wanting to show related (tag) content” which suggests that now the ALB is available on posts it will require some coding adjustments.

    Before I start making Josue’s coding adjustments, is that still the case or is there something in the pipeline to make this automatic?

    #439817

    Hi Annemarie!

    You can do this easily with the blog posts element. Drag it to your page or post (in a separate color section if you wish) and set it to display 4 posts in the blog grid style. For the custom taxonomy choose whichever tag you wish to use.

    Regards,
    Elliott

    #441516

    Hi Elliot
    I am jumping in here…
    When installing the theme the page called “blog” is empty and IN REALLY BLANK!
    We set this page up in the theme settings to show all blog posts (excerpts with a nice thump picture) see link http://www.god-dag.dk/blog
    But we want default on ALL blog posts to show “Related Posts” at the bottom of the blog post like author box and pagination and so on.
    We have set the Enfold setting to do this… (but must have missed a turn some where) :-) Cause nada is showing up – no related.
    I did add some same tags on a few posts (but the client don’t normally use tags). Don’t tell me I need add plugin from 3th part

    #442279

    Hi!

    You can edit loop-index.php, add this code somewhere in the template:

    //show related posts based on tags if there are any
                            get_template_part( 'includes/related-posts');
    

    You might need to edit related-posts.php, look for this code:

    wp_reset_query();
    

    Replace it with:

    if(is_singular()) wp_reset_query();
    

    Regards,
    Ismael

    #442358

    Hi Ismael,

    Thanks – I played around with placing the code “somewhere in the template” … I realized that it’s important where :-) I had the related show up around the entire blog … but not where I wanted it to show up :)
    Could you point out to me … Where I add the code to get it to show up after the entire blog article before the comment box please.
    Line number or look for X and replace or add after/before – WOULD BE GREAT!!

    Br

    Peter

    #442907

    Hey!

    Look for this code around line 199:

    // echo the post content
                echo '<div class="entry-content" '.avia_markup_helper(array('context' => 'entry_content','echo'=>false)).'>';
    

    Below, you can add the code:

    if(!is_single()) get_template_part( 'includes/related-posts');
    

    Don’t forget to modify the related-posts.php file.

    Best regards,
    Ismael

    #442928

    Hi Ismael,
    I did … first time… But then it shows up on the blog page where there are excerpts of each posts and a small thumpnail (featured image)???

    My line 198 – 203:

                // echo the post content
                echo '<div class="entry-content" '.avia_markup_helper(array('context' => 'entry_content','echo'=>false)).'>';
                echo $content;
                echo '</div>';
    //show related posts based on tags if there are any Added by Peter  www.BizDoktor.dk
                            get_template_part( 'includes/related-posts');
    
    #444799

    Hi!

    Please give us a link to the page. What is the current settings for Blog Layout > Related Entries?

    Best regards,
    Ismael

    #444928

    Hi Ismael,

    Link http://god-dag.dk
    Settings :

    When adding in your code … This is what shows up on BLOG page (not the post it self) but the OVERVIEW page where excerpts are lined up?
    The posts itself SHOWS no related whatsoever?

    #444929

    I would appreciate if we could get this fixed… 2 weeks in the “making” is too long?

    #446152

    Hey!

    That is a related post. Please check your own screenshot. You got two posts with the same featured image:

    Mindfulness i kampen mod alzheimers
    Lær på 1 minut: Styrk din produktivitet med 30%

    Cheers!
    Ismael

    #446317

    Hi Ismael,
    That is a related post showing up on the BLOG page where all blog excerpts are showing …. What you see is a POST excerpts and its related.
    Picture is from same post “featured”.
    In my world the related posts should show up under a POST and NOT on a blog post! – It is ONE post
    Cheers

    Peter

    #446866

    Hi!

    Sorry but I don’t understand you. I must be from mars. Isn’t that what you want? To see the related posts of a single post on the blog overview page? What’s the difference between a POST and “a blog post”? This is what I have on my installation when I do the modifications above.

    Regards,
    Ismael

    #447048

    Hi Guys,
    I have made a mockup of what we would love. When you open up the blog post itself and get to the bottom, all we want is to have posts that are related. Not related on the overview only at the bottom of the actual post. So in the image mockup, if we tag every topic with “case” the two cases for Novo Nordisk and Region Syd (so far) would be caught in the related posts widget.

    Related posts mockup

    Thanks for your patience.

    #447533

    Hi!

    @Anne: The related posts section should be there by default. You don’t need to add the modifications above. Make sure that you enable it on Enfold > Blog Layout > Related Entries. And note that the related entries are filtered by tags, not categories. But upon reviewing your original thread, looks like you built the posts using the advance layout builder, unfortunately, you will need to add the related posts section manually. Use the Blog Posts element. Or edit template-builder.php, look for this code:

    echo $content;
    

    Below, add this:

    //show related posts based on tags if there are any
         if(is_singular('post')) get_template_part( 'includes/related-posts');
    

    Cheers!
    Ismael

    #494024

    Hi team!
    Can I have excerpts under the related post images?
    Thanks!

    #494594

    Hi!

    Yes, it’s possible.You have to modify the includes > related-posts.php file. Add the get_the_excerpt() or the_excerpt() function.

    https://codex.wordpress.org/Function_Reference/get_the_excerpt

    Regards,
    Ismael

    #494727

    Ok, Thanks!

    #495188

    Hey,

    Glad we could help :-)

    Regards,
    Rikard

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