Hello,
it is possible to sort the “You might also like” Posts on the bottom of a Single Post by newest date?
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
It’s working fine thank you for your quick help :)
Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon