Mauer Themes › Support › Storyteller › Relted posts instead of "more posts"
- This topic has 9 replies, 2 voices, and was last updated 3 years, 9 months ago by
Paul.
-
AuthorPosts
-
June 21, 2017 at 11:43 am #1161
DdMMuc
ParticipantHi Paul,
14 days ago you told me (comment section themeforest) that you can help me that related posts are shown underneath a post article instead the “more posts” widget – just like in Essentils theme.
Could you please tell me what to do?Thanks,
JörgJune 22, 2017 at 7:28 pm #1163Paul
KeymasterHi Jörg,
Let me get to your questions tomorrow.
Paul
June 24, 2017 at 9:29 am #1168Paul
KeymasterJörg,
I’ve just emailed you two files that you can replace in your theme folder to have the related posts instead of the latest.
Paul
June 28, 2017 at 6:22 am #1177DdMMuc
ParticipantHello Paul,
thank you for the files, but I don’t understand what the criterias are for related articles. I mean how are the related articles chosen by the system? It can’t be the category or the tags.In my opinion it would be the best if the related posts are sorted by same category AND tags.
Would this be possible?
Jörg
July 1, 2017 at 7:29 am #1181DdMMuc
ParticipantI really would appreciate an answer.
Jörg
July 1, 2017 at 5:36 pm #1183Paul
KeymasterJörg,
The code that I provided suggests related posts based on category.
To have it also take into consideration the tags, you can go to single.php and change this line (should be around line 61):
<?php $related_posts = mauer_get_related_posts(get_the_ID(), "category", 2); ?>
to this:
<?php $related_posts = mauer_get_related_posts(get_the_ID(), "category", "post_tag", 2); ?>
Please note that this is an experimental feature and may not always work as expected.
Another option would be to try third-party solutions for related posts — e.g. the one built into the Jetpack plugin.
Regards,
PaulJuly 1, 2017 at 8:09 pm #1190DdMMuc
ParticipantThanks for your answer but I realized that there is a main problem. I replaced the single and functions.php you sent me with the original ones so that theme shows the newer and older posts “teaser” underneath the main post. But actually it always shows the same post “teaser” regardless which post page you are looking at.
Just see yourself at travelbar.de.
I deactivated all plugins but it change anything, also I checked with chrome, firefox and edge browser.
Do you have any idea what is wrong?
Thanks
JörgJuly 4, 2017 at 6:04 pm #1200DdMMuc
Participant???????? Any idea?
July 4, 2017 at 8:07 pm #1201Paul
KeymasterJörg, I’ll have a chance to get back to you with this tomorrow.
July 5, 2017 at 3:14 pm #1204Paul
KeymasterJörg,
Yes, this is exactly how it is supposed to work with the original theme files. Let me explain:
With the original files the ‘More posts’ area shows the two recent posts. This is by design. And that is what is happening on http://www.travelbar.de. The only exception is that if you are viewing one of the 2 recent posts, the ‘More posts’ section will not display this very post, as you are currently viewing it.
The 2 files I sent you change this behavior — they make the ‘More posts’ section display related posts based on category.
The little code modification that I provided above makes this section display related posts based both on category and tags. However, as I’ve mentioned before this is n experimental feature and may not always work as expected.
Regards,
Paul -
AuthorPosts
- You must be logged in to reply to this topic.