Hi @luna2442!
Give this bit of code a try for reversing the order of posts on category pages:
// Reverse order of posts on category pages
function reverse_category_order( $query ) {
if ( $query->is_category() && $query->is_main_query() ) {
$query->query_vars['order'] = 'ASC';
}
}
add_action( 'pre_get_posts', 'reverse_category_order' );
Place that in your child theme‘s functions.php
file, and you should see your category pages reversed ??
For the titles, if you want to remove the word Category, you can try this snippet (also in your child theme’s functions.php
file)
function my_archive_title( $title ) {
$parts = explode( ':', $title );
if ( count( $parts ) > 1 ) {
$title = array_pop( $parts );
}
return $title;
}
add_filter( 'get_the_archive_title', 'my_archive_title' );
Note – this will affect all archive pages on your site, not just categories. For example, it will also remove the word Tag: from tag archives, and remove Author: from author archives.