The easiest way to do this is to use a hook (the pre_get_posts
hook) to change the order. But you should check that the query is one for which you do want to alter the order! (is_archive()
or is_post_type_archive()
should be sufficient.)
For instance, put the following in your theme’s functions.php…
add_action( 'pre_get_posts', 'my_change_sort_order');
function my_change_sort_order($query){
if(is_archive()):
//If you wanted it for the archive of a custom post type use: is_post_type_archive( $post_type )
//Set the order ASC or DESC
$query->set( 'order', 'ASC' );
//Set the orderby
$query->set( 'orderby', 'title' );
endif;
};
Related Posts:
- Arrange and separate posts
- Default archive URL wordpress
- Increase number of posts in archive page
- How do I place content on archive pages but not on main page?
- WordPress Posts By Date/Day?
- Preventing 404 error on empty date archive
- Archive sorting functions by custom fields (front-end)
- Including post_type = ‘wiki’ in author archives
- Sorting archive pages with “pretty” URLs?
- Sort category page with custom field
- Archive listing of posts by publish year (multiple years)
- Archive filtering posts by year and month
- How to get the date dynamically from archive.php to date.php?
- Making next_posts_link(); return posts by month
- Count posts for each year
- How can I change the way dates shown in the archive widget?
- how do I get the date in a date archive page
- if in_category on archive.php
- Archive in sidebar with dropdown list of Year – Month – Day
- How can I organize/create an archive listing by Year and month
- Change behavior depending on content length
- How to edit archive page’s content inside wordpress dashboard?
- Archive pages for posts based on their taxonomy?
- How can I get archives for specific category without category_base in the url?
- condition for only if is archive for default post type
- Remove author archive
- Preview Post/Custom Post types in Archive
- Displaying year, month and day archives differently
- What’s wrong with my date_query?
- How we display Archives for specific categories
- When i try to open archive pages i get a 404 error
- Archive links don’t work when clicked
- wp_get_archives() display months even if there is no posts
- how do I encode links to specific archive searches?
- Some archive by year page return 404
- Group Posts by Category in Monthly Archive
- Loop through years and months in WordPress archives
- Dropdown to select posts by month and then displaying those posts in the archive page
- How to filter by date & a specific custom post type post-WP 4.4?
- Having a problem with Next and Previous Links
- Custom post type archive page thinks I’m not logged in
- ‘Archive’ folder for posts and pages
- Filter post by clickable year [duplicate]
- next and previous year month and day for archive page
- Get current title of archive.php
- How to show months in wordpress archive page?
- I want my yearly archives to show a list of all posts
- How can I modify this to show number of posts-per-month?
- How to count the number of archives there are
- Get archives as array
- Create an archive listing based on meta array
- Can’t Access Sessions or Variables through pages
- How to make an archive page template using WordPress 3
- How to display an archive with multiple authors
- Why is my archive.php redirecting to front-page.php?
- How to get post archives urls list without any markup?
- How can I loop only months foreach year?
- Where is the content that is outputted by get_the_archive_description()?
- Create simple columned archive page
- I created a normal page, but the page displays as an archive page
- How to hide specific post type from archive?
- On my archives page, I can’t see my custom post types catergories
- How to get the Custom Post Type Archive inside a folder
- WordPress archives in header -necessary?
- Blog pages show at most unrecognized by code
- Any kind of custom post type in the front page and in the archive listing
- How to get type of archive whether it is post or date or category archive?
- Display an archives name
- How can I create a master archive?
- Custom design calendar archive
- Over 500.000(!) unwanted archive pages, major duplicate content problem
- Link back to (paged) archive and find the correct page
- How to show all the posts under the same Year in a page WordPress?
- How to share the author’s archive?
- How can I show a list of posts using the dynamic selection box?
- My page is shown as archive in my site
- How can I noindex my archive pages?
- Orderby event date (if it exists) or post date (if it doesn’t) – how to reorder posts based on meta value OR date
- google index an Post type page I do not want
- Change Title Based on Taxonomy Filter in archive-{cpt}.php
- How to remove or hide archive page?
- How can I modify wp_get_archives() to not use archive.php template?
- Get all posts from db between 2 specified months
- Archives widget doesn’t work?
- Archive – Show Video from First Post
- Missing content on author archive page
- Yearly Archive Page?
- date.php shows only three posts’ title. how to fix it?
- How to hide the year in archive link
- Show recent posts in single-post page
- How to edit wordpress post without republishing
- Is each issue of a magazine site a static page
- How to get alphabetic listing x other posts, based on first letter post?
- How can i display in themplate file only a few post
- How to create an archive section of a WordPress site
- how to hide all posts under one category
- How to remove “Archives” after category name?
- Filter the post listing for a particular category from archive month list
- How to have infinite scroll consider passed parameters?
- Filter/Sort Post Form On Taxonomy page