-
-
Notifications
You must be signed in to change notification settings - Fork 513
term.posts not sorted by menu_order by default #1917
Copy link
Copy link
Closed
Description
I'm using Timber::get_terms to get non-empty terms for a given taxonomy. Each one of those terms is correctly sorted (given their menu_order). After looping over this, I need to print the posts using the current term. This is were things don't work as expected.
Somewhat related to #1366 maybe?
Expected behavior
I'd expect work.posts to be returned according to their menu_order just like the default WP_Query would do when using one of these plugins:
- https://es.wordpress.org/plugins/intuitive-custom-post-order/
- https://es.wordpress.org/plugins/simple-custom-post-order/
Actual behavior
Returned posts are ordered by some other parameter, I guess it must be because the class has some kind of default arguments in case they're not provided.
Steps to reproduce behavior
Here's a simplified version of what I'm doing:
$data['works'] = Timber::get_terms(
array(
'taxonomy' => 'category',
'hide_empty' => true,
)
);{% for work in works %}
<ol>
{% for project in work.posts %}
<li>{{ project.title }}</li>
{% endfor %}
</ol>
{% endfor %}What version of WordPress, PHP and Timber are you using?
WordPress 5.0.3, PHP 7.2, Timber 1.8.4.
How did you install Timber? (for example, from GitHub, Composer/Packagist, WP.org?)
Upgraded to newest version via plugin updater in WordPress dashboard.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels