• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Create an archive page listing of articles in WordPress sorted by date

By Abhishek Ghosh March 11, 2011 8:38 pm Updated on November 8, 2014

Create an archive page listing of articles in WordPress sorted by date

Advertisement

This tutorial discusses a method to automatically create an archive page in WordPress showing all your articles chronologically by dates.

 

Create an archive page listing in WordPress by date in WordPress

 

Recall that, WordPress by default shows archives by month.

 

To implement this chronological archival page, we will suggest you to use a separate page template to avoid changing your theme. However, you may directly take the challenge to change the standard archive.php file.

Advertisement

---

 

Building the model of a WordPress page

 

Code might be faulty due to Crayon Syntax Highlighter’s over work. Please debug.
Additionally, this is very old post. There are good plugin for this work.

In your theme folder, duplicate the page.php file for reuse the HTML structure of your site. Rename the file for convenience. You might know, we already wrote how to create a PHP file in Windows 7 without any software.

 

Paste in the first instance these initial lines of code there by telling it is a WordPress template. First add PHP opening.

Then, just after the command php the_content insert this:

Vim
1
2
3
4
5
6
7
8
<? php
previous_year $ = $ year = 0;
$ month = $ previous_month = 0;
$ ul_open = false;
$ my posts get_posts = ('number posts =- 1 & orderby = post_date & order = DESC');
?>
<? php foreach ($ my posts as $ post):?>
<? phpsetup_postdata ($ post);$ Year = mysql2date ('Y', $ post-> post_date); $ month = mysql2date ('n', $ post-> post_date); $ Day = mysql2date ('j', $ post-> post_date); ?> <? php if ($ year! Previous_year = $ | | $ month! = $ Previous_month)?> <? Php if ($ ul_open == true)?> </ul> <? Php endif;?> <h3> <? php the_time ('F Y');> </ h3> <ul> <? php $ ul_open = true;?> <? Php endif;?> <? Php $ year = $ previous_year; previous_month $ = $ month;?> <li> <span> <? php the_time ('F j');> - </ span> <span> <a href = "<? php the_permalink () ?>"><? php the_title (); ?> </ a> </ span> </ li> <? Php endforeach;?> </ ul>

 

Remember to save the file on your server via FTP in the /wp-content/themes/YOUR_CURRENT_THEME/

 

Publication of the chronological archive page

 

Then log into your WordPress admin and then apply the page template we just created.

You can; for example, create a page named Archive. In the Page Attributes module, select Archive (or what ever the name you used to save the page template) as model:

 

Create an archive page listing in WordPress by date

 

Note: You may need to modify the method for themes which uses own or modified platform.

This Article Has Been Shared 730 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Create an archive page listing of articles in WordPress sorted by date

  • Reasons to use WordPress for business or a blog website

    WordPress is the blogging platform used most in the world, which powers up the simple personal blogs of world-famous companies. This open source platform written in PHP and based on the use of a MySQL database is developed by the company Automattic.

  • 66 possible topics for your blog

    Here are some topics to write blogs, which are almost guaranteed to give you good ranking in search engine result pages for long run, if you do care about SEO.

  • Earn More Money per day online with Google Adsense using our top 7 tips

    Earn More Money from your blog using our top 7 tips from your Good AdSense Ad revenue.

  • Make Money with Google AdSense Guide for Dummies : Part 1

    Make Money with Google AdSense – not in three digit numbers, may be four or more. Here is Google AdSense Guide for those who knows nothing about how to earn so.

  • Customize the width of body and sidebar of WordPress blog

    You can easily customize your Wordpress theme’s width of content area and sidebar widget area by manipulating the CSS file.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Comments

  1. AvatarPulkit Kaushik says

    September 13, 2011 at 8:36 pm

    You need to make your posts more reader friendly. I didn’t understand where to find the_content. Try to be more elaborate next time.

  2. AbhishekAbhishek says

    September 13, 2011 at 10:56 pm

    You will find

    the_content

    within

    the_loop

    . You will get reference of both in WordPress Codex.

    You are using Elefolio Premium Theme from Woo Themes. Woo Themes uses generic loops. Please contact Woo Themes’ support mentioning this post, they will guide you how to add it.

  3. AvatarChristian says

    March 7, 2012 at 10:36 am

    Although useful, you have made a mockery of the copy/paste by forcing your website credits into the copied text. No one in their right mind would type out the code you have provided.

  4. AbhishekAbhishek says

    March 7, 2012 at 11:55 am

    Christian, we understand its a big problem now for the nice innocent users for copying the code parts in guides.

    The idea of enforcing url copyright text was to fight the copy-paste bloggers, your comment gave a nice feedback and we will try to exclude the code parts as soon as possible those are getting in to the codes too. Its not only impossible to type out the code as rightly said by you, but also there is a possibility of getting errors if those are not sanitized / chopped out by the new users, specially for php and .htaccess codes.

    Again thank you very much for the feedback.

  5. AvatarYogesh says

    October 13, 2012 at 12:20 pm

    Thanks for this tutorial. When I applied for socialpark, I got rejected just because my blog was not having chronological archive. With your article my blog was approved. Thanks for sharing.

  6. AbhishekAbhishek says

    October 14, 2012 at 6:23 pm

    Congrats. Thanks a lot for reporting it back.

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What Online Casinos Have No Deposit Bonus in Australia March 30, 2023
  • Four Foolproof Tips To Never Run Out Of Blog Ideas For Your Website March 28, 2023
  • The Interactive Entertainment Serving as a Tech Proving Ground March 28, 2023
  • Is it Good to Run Apache Web server and MySQL Database on Separate Cloud Servers? March 27, 2023
  • Advantages of Cloud Server Over Dedicated Server for Hosting WordPress March 26, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Create an archive page listing of articles in WordPress sorted by date," in The Customize Windows, March 11, 2011, March 31, 2023, https://thecustomizewindows.com/2011/03/create-an-archive-page-listing-of-articles-in-wordpress-sorted-by-date/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT