How to order the "RELATED ARTICLES" name

Posted in: Newspaper
Post count: 34

The “related articles” are sorted by date, and sort by name tag?

For example, if an article I put the tags: Music, Videos, Review.
I wish related articles appear in this order: first all the items of the tag “Music”, then “Review” and finally “Videos”.

  • This topic was modified 9 years by diablo7.
Post count: 22421

Hello,

Unfortunately the related articles do not have this functionality. It will bring the latest posts from all categories. If you change the sorting order hard-coded you change it for the post themselves not the categories. You can try to change the sorting order for posts like so:
Add this line of code here: http://screencast.com/t/omWMQ8AOx7ML
$atts['sort'] = 'random_posts';

Instead or random posts you can use any of these sorting options:
oldest_posts, popular, popular7, review_high, alphabetical_order, comment_count, random_today, featured
Just change the text between the quotation mark with another of the sorting options but there is no such sorting in our theme as you describe. sorry.

Thanks

Post count: 13

how to sort related by Descending from view count post ?
can i using this code :
'orderby' => 'meta_value_num',
'meta_key'=> 'post_views_count',
'order' => 'DESC',

  • This reply was modified 9 years by faris.
Post count: 22421

Hi,
The sorting options are created in td-data-source.php here: http://screencast.com/t/GJbeasmChdUi If you want a different sorting option , use the code I provided above and simply change the case with one from the data-source file
Thank you!

Post count: 13

thanks Bogdan,

Post count: 13

hi @[bogdan-b],
can i filter by tag ?
i want To exclude slug from related ?

Post count: 22421

Hello,

The related articles element allows you to filter the posts by tag from the theme panel like so: http://screencast.com/t/gvceUe9Z

Thank you!

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newspaper’ is closed to new topics and replies.