In our WordPress tutorial series you have already seen how to install the WordPress core files and begin publishing content to your site in the form of posts, pages, media, etc. After reading this article you will know how to organize your posts alphabetically for your readers.
By default, WordPress will display published posts in the order they were published. This can be changed by adding a snippet of code to the functions.php file in the WordPress core configuration.
Bear in mind, editing the source code of your WordPress installation can be hazardous. Make sure to copy the code samples and paste them exactly.
You will need to access the functions.php file in the wp-content/themes folder for the WordPress theme you're using. In this example, I'm using the default "twentysixteen" theme.
Here is the code you will need:
Place the above snippet of text on the first available line after the initial comments.
You can edit the functions.php file with any text editor or via FTP or the cPanel File manager.
After adding the code snippet, save the file, and reload your Wordpress front page. You'll now notice your posts diplay in alphabetical order on your front page.
This modification can also be applied to individual categories.
Whenever editing the source code of any WordPress installation it is always wise to save a backup of the original file. An accidental edit can inadvertently wipe out critical data.
In the case of WordPress themes, you can keep an untouched copy in a safe location to be restored if necessary; or, if possible, you can re-download the source files from the developer.
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: |
877-595-4HUB (4482) 757-416-6627 (Intl.) |
Chat: | Click To Chat Now |
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!