Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1296923

    Hello,
    it is possible to sort the “You might also like” Posts on the bottom of a Single Post by newest date?

    #1297553

    Hi derdschuh,

    Yes, please use a child theme first if you don’t have one yet, you can download and find instructions in this thread: https://kriesi.at/documentation/enfold/child-theme/
    Copy related-posts.php in the includes folder of enfold, then in the child theme create a folder called includes then paste the file inside it.
    Find this code in line (77-84):

            $my_query = get_posts(
                                array(
                                    'tag__in' => $tag_ids,
                                    'post_type' => get_post_type($this_id),
                                    'showposts'=>$postcount, 'ignore_sticky_posts'=>1,
                                    'orderby'=>'rand',
                                    'post__not_in' => array($this_id))
                                );

    and replace it with this code:

            $my_query = get_posts(
                                array(
                                    'tag__in' => $tag_ids,
                                    'post_type' => get_post_type($this_id),
                                    'showposts'=>$postcount, 'ignore_sticky_posts'=>1,
                                    'orderby'          => 'date',
                                    'order'            => 'DESC',
                                    'post__not_in' => array($this_id))
                                );

    Let us know if this helps.

    Best regards,
    Nikko

    #1297588

    It’s working fine thank you for your quick help :)

    #1297642

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Sorting "You might also like"’ is closed to new replies.