• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Place date before title

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Place date before title

This topic is: resolved

Tagged: post meta, post title

  • This topic has 5 replies, 2 voices, and was last updated 10 years, 1 month ago by websitestory.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • June 8, 2015 at 9:05 pm #155481
    websitestory
    Member

    Hi all,

    I'm working on a custom theme and trying (unsuccessfully) to position the date before the post title. I have managed to change the post meta to show what I'd like but I really want it all on the same line as the post title.
    If anyone can point me in the right direction I would be so grateful.

    Thank you!

    June 8, 2015 at 9:11 pm #155483
    Erik D. Slater
    Member

    You mean something like this screenshot here?


    Erik D. Slater: Digital Platform Consultant • LinkedIn
    June 8, 2015 at 9:14 pm #155484
    websitestory
    Member

    Hey Erik,

    Thanks for the reply. Almost like that but I'd like them on the same line e.g.

    9th June 2015 - This is the post title

    Hope that makes sense

    Cheers

    June 8, 2015 at 9:27 pm #155485
    Erik D. Slater
    Member

    Take a look at this: https://wordpress.org/support/topic/make-date-part-of-the-title

    I just tested it and it works. You would just need to modify the date format.


    Erik D. Slater: Digital Platform Consultant • LinkedIn
    June 8, 2015 at 10:44 pm #155492
    websitestory
    Member

    Awesome thanks Erik! I will test it out and let you know how I go. It seems relatively straightforward.

    Cheers.

    June 9, 2015 at 3:05 am #155543
    websitestory
    Member

    If anyone else is interested to do the same, the code Erik pointed me to worked great. My only change was no date format which then uses the date format in WordPress and I wrapped the date up in a span with a class so I can style it separately. Here it is:

    //* Add date before title
    add_filter( 'the_title', 'add_date_to_title', 10, 2 );
    function add_date_to_title( $title, $id ) {
    	// if not a wp-admin page
    	if ( !is_admin() ) {
    		// if it's inside the main loop
    		if ( in_the_loop() && is_main_query() ) {
    			// add date to title
    			$title = '<span class="date">' . get_the_date() . '</span>' . ' ' . $title;
    
    		}
    	}
    	return $title;
    }
    
  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble