• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
Callia Web logo

Callia Web

Websites - Design with Purpose

  • Digital toolkits
    • Venture toolkit
    • Go-pro toolkit
    • Intrepid toolkit
  • Services
    • Digital toolkits
    • Design services
    • Simple websites
    • Support and care plans
    • Website consultation
  • Our Work
  • Processes
    • Accessibility matters
    • Branding Process
    • Toolkit and website process
  • About
  • Let’s Talk

Add date title to Genesis date archives

18 Apr 2014 | WordPress

There is a question in the StudioPress forum which asks how to add a date title to the date archives – the page that displays all posts from a particular month, such as https://www.calliaweb.co.uk/2014/02/

Thinking this would be a nice feature for this site I set about writing a function to achieve this.

On this site I’ve moved the location of my titles so they are above the content and sidebar, so the code below is not exactly what I am using here, but should work for most themes with the titles appearing in the usual place.

This code goes in your functions.php file.

As always I remind you to have a backup of your website before you edit your functions file and if you are not comfortable with editing your functions file then do ask a Genesis developer to do it for you. You\’ll find loads of Genesis developers hanging out on Twitter under the #genesiswp hashtag.

You can also see this code on github.

add_action( 'genesis_before_loop','jmw_add_archive_date_title', 15 );
/**
 * Add date headline to date archive pages.
 *
 * If we're not on a date archive page then nothing extra is displayed.
 *
 * The date is marked up as a level 1 heading.
 *
 * @return null Return early if not date archive 
 */
function jmw_add_archive_date_title() {
	if( !is_date() ) {
		return;
	}
	
	echo '<div class="archive-description">';
		echo '<h1 class="archive-title">'. single_month_title( ' ', FALSE ) .' Archive</h1>';
	echo '</div>';
}

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on E-mailShare on WhatsApp

About Jo Waltham

Jo Waltham is the founder of Callia Web and is passionate about helping small business owners and bloggers with their websites and online marketing. Connect with Jo and the rest of the Callia Web team on Twitter or Facebook. Alternatively send us a message.

Liked this post? Subscribe to get our next post direct to your inbox.

  • Please enter your email address if you would like us to contact you by email with information about our services which we feel may be of interest to you. We will process your data in accordance with our privacy notice. You may withdraw this consent at any time by clicking the unsubscribe link in any message we send, or by emailing hello@calliaweb.co.uk.
Previous Post: « Choose web hosting How do you choose the best web hosting?
Next Post: What is new in Genesis Framework 2.1.1 developer writing code »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Ready to take your project to the next step?

Give us a call, we’re here to discuss what your project needs.

Let’s get started

Contact us

Telephone: 01672 666001 / 666002

Email: hello@calliaweb.co.uk

  • Facebook
  • Twitter
  • Instagram

Quick links

Digital toolkits

Services

Our work

Testimonials

Blog

Popular posts

Using headings in WordPress

Accessibility basics

Image sizes and aspect ratios

Making images equal size

Beginner’s guide to Analytics

Legal

Privacy policy

Terms of service

Company number: 08316519

VAT number: GB204336250

Registered address: Bowman House, Royal Wootton Bassett, Wiltshire, SN4 7DB

Copyright © 2022 · Callia Web Ltd · All Rights Reserved