Tagged: excerpt, related posts
-
AuthorPosts
-
May 4, 2015 at 11:32 am #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?
May 5, 2015 at 4:36 pm #439817Hi 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,
ElliottMay 8, 2015 at 2:34 pm #441516Hi 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 partMay 11, 2015 at 9:10 am #442279Hi!
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,
IsmaelMay 11, 2015 at 11:20 am #442358Hi 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
May 12, 2015 at 10:47 am #442907Hey!
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,
IsmaelMay 12, 2015 at 11:24 am #442928Hi 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');
May 15, 2015 at 8:05 am #444799Hi!
Please give us a link to the page. What is the current settings for Blog Layout > Related Entries?
Best regards,
IsmaelMay 15, 2015 at 2:37 pm #444928Hi 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?May 15, 2015 at 2:38 pm #444929I would appreciate if we could get this fixed… 2 weeks in the “making” is too long?
May 19, 2015 at 2:40 am #446152Hey!
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!
IsmaelMay 19, 2015 at 10:51 am #446317Hi 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
CheersPeter
May 20, 2015 at 2:45 am #446866May 20, 2015 at 11:58 am #447048Hi 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.Thanks for your patience.
- This reply was modified 9 years, 7 months ago by AnnemarieDoolin.
May 21, 2015 at 3:52 am #447533Hi!
@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!
IsmaelAugust 27, 2015 at 11:20 am #494024Hi team!
Can I have excerpts under the related post images?
Thanks!August 28, 2015 at 4:03 am #494594Hi!
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,
IsmaelAugust 28, 2015 at 10:24 am #494727Ok, Thanks!
August 29, 2015 at 6:48 am #495188 -
AuthorPosts
- You must be logged in to reply to this topic.