How to introduce today's date just below the logo?

Community Forums Forums Design Tips and Tricks How to introduce today's date just below the logo?

This topic is: not resolved

Tagged: , ,

This topic contains 5 replies, has 2 voices, and was last updated by  Sridhar Katakam 10 months, 2 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #66061

    hich
    Participant
    Post count: 16

    Hi,

    I’m using the Metro Theme for a magazine publication, and would like some help on how to insert today’s date on the home page just below the logo.
    It should not affect all the other pages or landing pages, just the home page.

    Many thanks for your support,

    #66080

    Sridhar Katakam
    Participant
    Post count: 1063

    Add this in functions.php:

    add_action ( 'genesis_site_title', 'sk_add_date' );
    function sk_add_date() {
    	if ( is_home() || is_front_page() ) {
    		echo date(get_option('date_format'));
    	}
    }

    #66215

    hich
    Participant
    Post count: 16

    Thanks a lot for your answer!
    Is there any way to insert a class so I can customize a bit the date?
    Also do you know how to include the date format with the day of the week (Friday 11 October 2013)
    Many thanks again, appreciate your help.

    #66218

    Sridhar Katakam
    Participant
    Post count: 1063
    add_action ( 'genesis_site_title', 'sk_add_date' );
    function sk_add_date() {
    	if ( is_home() || is_front_page() ) {
    		echo '<span class="today-date">' . date('l j F Y') . '</span>';
    	}
    }

    #80010

    hich
    Participant
    Post count: 16

    Hi Sridhar,

    Many thanks for your help and support! My last question sorry, how to introduce the date for all the pages? We finally decided to keep it for all the pages, not only the home page?

    Hope to hearing about you.

    #80138

    Sridhar Katakam
    Participant
    Post count: 1063

    Change the earlier code to

    add_action ( 'genesis_site_title', 'sk_add_date' );
    function sk_add_date() {
    	echo '<span class="today-date">' . date('l j F Y') . '</span>';
    }

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.