Relted posts instead of "more posts"

Mauer Themes Support Storyteller Relted posts instead of "more posts"

This topic contains 9 replies, has 2 voices, and was last updated by  Paul 1 year, 11 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1161

    DdMMuc
    Participant

    Hi 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örg

    #1163

    Paul
    Keymaster

    Hi Jörg,

    Let me get to your questions tomorrow.

    Paul

    #1168

    Paul
    Keymaster

    Jö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

    #1177

    DdMMuc
    Participant

    Hello 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

    #1181

    DdMMuc
    Participant

    I really would appreciate an answer.

    Jörg

    #1183

    Paul
    Keymaster

    Jö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,
    Paul

    #1190

    DdMMuc
    Participant

    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?

    Thanks
    Jörg

    #1200

    DdMMuc
    Participant

    ???????? Any idea?

    #1201

    Paul
    Keymaster

    Jörg, I’ll have a chance to get back to you with this tomorrow.

    #1204

    Paul
    Keymaster

    Jö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

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.