• Resolved dararede

    (@dararede)


    Is it possible to show all posts in category, currently category is showing only top 10 newest posts. Also is is possible to list it alphabetically?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi dararede. You can set the number of posts per page in Settings > Reading ? Blog pages show at most __ posts.

    To sort posts by title alphabetically, add this function to a child theme functions.php file:

    /* sort posts alphabetically by title */
    function my_posts_sort( $query ) {
        if ( $query->is_main_query() && ! is_admin() ) {
          $query->set( 'orderby', 'title' );
          $query->set( 'order', 'ASC' );
        }
        return;
    }
    add_action( 'pre_get_posts', 'my_posts_sort', 1 );
    Thread Starter dararede

    (@dararede)

    It is working how I wanted now! Thanks bdbrown!

    You’re welcome. Glad I could help. If you don’t need any further assistance with this topic please mark it as Resolved. Thanks.

    Thread Starter dararede

    (@dararede)

    Sure! 😉

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Display all posts in category’ is closed to new replies.