WordPress is the most popular blogging platform for bloggers. This post will show you how to change the order of posts and pages in WordPress themes. Here are a few ways you can customize the sorting order of your posts in WordPress.
Customize WordPress Post Order Manually
Open your theme and enter the following code to customize the post order manually:
// display posts organized by title in ascending order
This code will display a specified number of posts, in ascending order according to the post title. This code can be customized in many ways to suit your needs.
Another useful trick is to customize the order of categories, such as in an archive directory or service directory. Replace the first line in the loop example above with the following:
<?php if (is_category()) { $posts = query_posts( $query_string . '&orderby=title&order=asc' ); } ?>
You can also add another endif to the loop as follows:
<?php endif; ?>
<?php endif; ?>
You can also replace is_category() with the is_whatever() statements of your choice.
is_home()is_single()is_author()is_search()is_archive()
For more information, visit the WordPress Codex.
Plugins to customize post order automatically
We'll look at some simpler custom sorting methods using WordPress plugins.
1. Custom Query string Reloaded for WordPress
Custom Query Reloaded is a popular WordPress plugin. CQS (Custom Query String) offers an Admin Options Panel where users can specify as many custom post queries as they wish. CQS allows for custom sorting.
2. Smart Sort WordPress Plugin: Sort posts by Custom Field
This plugin lets you place a sorting bar with the option to sort posts based on any custom field. The sort bar can be placed above or below the list of posts within a category, archive or anywhere else in your template.
This plugin can help you reorder the posts that WordPress displays.
Post Types Order adds drag-and-drop ordering to posts, pages and any custom post type, and can apply that order to archives and queries — which is what you want when using WordPress as a content management system rather than a reverse-chronological blog. It is actively maintained and tested against the current WordPress release.
It replaces aStickyPostOrderER, which this article used to recommend; that plugin was removed from the WordPress plugin directory in December 2023 and can no longer be installed.
4. WP-Snap! WordPress Plugin
Heads up: WP-Snap! is still listed on the WordPress plugin directory but has not had a release since August 2010, and it is no longer actively maintained.WP-SNAP! WordPress Plugin that creates alphabetical listing ABCDEF etc. Links on a template file. Clicking "A", "D", and "Z" will display all post titles beginning with the letter you selected.
5. Sort category posts by title
This plugin appears to be a simple and quick way to sort category posts alphabetically in ascending order based on the post title. The plugin's home page states that "WordPress sort category posts by title" was created for WordPress 2.0.2. It only changes the order of the posts in category view. This will not affect the ordering of the posts on other pages (e.g. the homepage) of the site. This plugin's code is clean and simple. It just begs to be explored and adapted.












Responses (0 )