Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #986719
    gregwebb44
    Participant

    I’m trying to make it so that when someone clicks on a podcast category here: http://purplerocketpodcast.com/podcast/

    …they’re taken to a list of the podcast episodes in ascending order (starting with episode 1). But right now, every time I publish a new post/episode to a category it displays the episodes in descending order. See screenshot attached.

    Any help would be much appreciated!

    #987130
    Nabeel A
    Moderator

    Hi There,

    WordPress always displays posts in ascending chronological order. X theme does not modify this default behavior unless you’ve customized it. Even if you modify the order, X will still show the latest posts from the categories you select.

    Thank you!

    #988537
    gregwebb44
    Participant

    So there’s no way around it?

    #988999
    Rue Nel
    Moderator

    Hello There,

    Because what you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Once you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.

    // Change the order on category pages
    // =============================================================================
    function custom_order_in_category( $query ) {
        if ( $query->is_category() && $query->is_main_query() ) {
            $query->set( 'order', 'ASC' );
        }
    }
    add_action( 'pre_get_posts', 'custom_order_in_category' );
    // =============================================================================

    We would loved to know if this has work for you. Thank you.

  • <script> jQuery(function($){ $("#no-reply-986719 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>