• Thank you so much for making and supporting these really useful plugins!

    With the ‘Reorder Posts’ plugin I can easily reorder posts on archive.php.

    I am now using ‘Reorder by Term’ to try and order posts on category.php. In this case the custom ordering still has no affect.

    Sorry in advanced if the next two questions seem more about my ignorance on how WP taxonomy works than your plugin…

    On category.php I am using a shared template ( loop.php ) to loop through the posts.

    loop.php uses the common if have_post() / the_post()’ pattern.

    In your examples I see that you use get_posts() and then a foreach to loop.

    Should I refactor my loop.php, using get_posts(), to render the custom order? Or, can I pass an argument to the_post() or something else?

    If I do refactor, will I still be able to dynamically show any category’s posts through the url ‘category/category-slug-name’?

    It seems like the examples assume a taxonomy to be defined in the loop or no?

    Thank you again,
    Help and I’ll evangelize your great work!

    https://www.ads-software.com/plugins/reorder-by-term/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Tharon-C

    (@tharon-c)

    I don’t know if I was clear about my over all goal in the post above.

    When a category link on page A is clicked the user goes to page B that shows a list of posts under that category in a specified order.

    I would like to:

    • Add or remove categories in the admin
    • Add a category to a post in the admin
    • Order the posts under that category in the admin

    This works for me:

    add_action('pre_get_posts', 'order_category_pages');
    function order_category_pages($query) {
    	if(is_category()){
    		$query->set('orderby', 'menu_order');
    		$query->set('order', 'DESC');
    	}
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display order on categories page’ is closed to new replies.