June 21, 2017 at 11:43 am #1161
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?
JörgJune 22, 2017 at 7:28 pm #1163
Let me get to your questions tomorrow.
PaulJune 24, 2017 at 9:29 am #1168
I’ve just emailed you two files that you can replace in your theme folder to have the related posts instead of the latest.
PaulJune 28, 2017 at 6:22 am #1177
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örgJuly 1, 2017 at 7:29 am #1181
I really would appreciate an answer.
JörgJuly 1, 2017 at 5:36 pm #1183
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); ?>
<?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.
PaulJuly 1, 2017 at 8:09 pm #1190
Thanks 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?
JörgJuly 4, 2017 at 6:04 pm #1200
???????? Any idea?July 4, 2017 at 8:07 pm #1201
Jörg, I’ll have a chance to get back to you with this tomorrow.July 5, 2017 at 3:14 pm #1204
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.
You must be logged in to reply to this topic.