![]() That’s why we’re using the prefix tmpl_ here.) All file names starting with page- will be treated as new page templates within the main file hierarchy of WordPress themes. (Make sure not to call your page something like page-archives.php. Therefore, starting with the page.php file of the Zerif Lite theme, I’m going to make a copy and call it tmpl_archives.php. It’s probably one of the simplest page templates in your theme’s structure.Its structure is already optimized to display custom content within the main content block.The best model on which to build your archive page is the page.php file of your current theme, for a couple of reasons: You can use the approach presented here with any other theme. Nonetheless, it was one of the 10 most popular themes released last year in WordPress’ theme directory, so I hope you’ll let this one slide.Īnd, hey, if you don’t like the theme, no hard feelings. I admit, I may be a bit biased here because it is one of our own themes (at ThemeIsle). That being said, we do have to start by using some theme as the base of our work here. Lastly, the page will be responsive and will not depend on the current theme of the website it’s being used on. add additional widget areas (to display things like the most popular content, categories, tags).list the 15 latest posts (configurable).include a custom welcome message (may contain text, images, an opt-in form, etc.This template will allow us to do the following: Our custom archive page will be based on a custom page template. Here’s what we’re going to do in a nutshell. How To Build A Custom Archives Page In WordPress That is why we’re going to create a custom archive page. So, what we really need here is a middleman, a page that welcomes the visitor, explains that they’re in the archive and then points them to the exact piece of content they are interested in or suggests some popular content. So, if you want to allow visitors to dig into the archive in any clear way, you’d probably have to devote a whole sidebar just to the archive (just to be able to capture different types of organization, such as a date-based archive, a category archive, a tag archive, an author archive and so on). Right now, the only built-in way to showcase the archive links on a WordPress website is with a widget. While this sounds like a good idea from a programmer’s perspective, it doesn’t make much sense from the user’s point of view. Or, more accurately, one layer is missing here - a layer that would come between the user’s intent to find content and the individual items in the archive themselves. At the end of the day, these various archive pages are just versions of the index page that filter content published during a specific time period or by a particular author or with particular categories or tags. ![]() The idea behind such an archive structure is to provide the blog administrator with a way to showcase the archive based on various criteria, but to do so in a simplified form. In fact, the only visible difference between the index page and the archive page is the additional header at the top, which changes according to the particular page being viewed. Looking at the directory listing of the default theme at the time of writing, Twenty Fifteen, we find the following:ĭespite their different purposes, all of these pages are really similar in structure, and they usually only differ in a couple of places and several lines of code. In WordPress, you get to work with a range of different page templates and structures in the standard configuration. Responsive Images In WordPress With Art Directionīut first, what do we mean by “archive page” exactly?.Customizing WordPress Archives For Categories, Tags And Other.A Detailed Guide To WordPress Custom Page Templates.How To Create And Customize A WordPress Child Theme.The best part is that you will be able to use it with any modern WordPress theme installed on your website at the moment. Let’s fix that today! Let’s build an archive page for WordPress that’s actually useful. As great as WordPress is, the standard way in which it approaches the archive is far from user-friendly. Or, more likely, you’d probably not even think of the archive template at all - that’s how unpopular it is. If I were to ask you what the least used default page type in WordPress is, chances are you’d say the archive template. Or, more likely, you’d probably not even think of the archive template at all - that’s how unpopular it is. If I were to ask you what the least used default page type in WordPress is, chances are you’d say the archive template.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |