• 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 426 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (20K Followers)
  • Twitter (4.9k Followers)
  • Facebook (5.8k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.2k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is Software Modernization? January 21, 2021
  • Cloud Computing : Cybersecurity Tips for Small Business Owners January 20, 2021
  • Arduino : Independently Blink Multiple LED January 18, 2021
  • What is a Loosely Coupled System? January 17, 2021
  • How To Repack Installed Software on Debian/Ubuntu January 16, 2021

 

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, January 21, 2021, https://thecustomizewindows.com/2011/03/create-an-archive-page-listing-of-articles-in-wordpress-sorted-by-date/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

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

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

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