WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Theme Billion] Time stamp a day out (5 posts)

  1. helpingmedia
    Member
    Posted 1 year ago #

    Hi,

    The time stamp to the right of the main menu in my template (Billion) is out by a day. I have the right date in the settings and on my computer. Any clues?

    http://www.mediahelpingmedia.org/blog/

    Perhaps it is meant to show the date of the last time the site was updated. If so, which file do I need to edit to add 'Last updated:'.

    Alternatively, if it can't be fixed, which file do I edit to comment it out?

    David

  2. helpingmedia
    Member
    Posted 1 year ago #

    I have realised what it is. The time stamp to the right of my top menu relates to the page or item you are viewing at the time, not today's date.

    http://www.mediahelpingmedia.org/blog/

    So now my question is how do I disable it? Does anyone know how to comment it out and which file I need to edit, please?

    David

  3. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    in functions.php:

    add_filter( 'wp_nav_menu_items', 'billions_date_menu_item', 10, 2 );
    function billions_date_menu_item( $items, $args ) {
     	if( $args->theme_location == 'primary' ) {
    		$homelink = '<li class="menu-item right date">' . get_the_time( 'l, F j, Y' ) . '</li>';
    		$items =  $items . $homelink;
    	}
    	return $items;
    }

    if you change 'get_the_time' to 'date' you should get the current date output.

    if you remove the code, the date should be gone.

  4. helpingmedia
    Member
    Posted 1 year ago #

    Fantastic, thanks. It worked. I wish I knew how to do this stuff. Very grateful. Looks great now. David

  5. helpingmedia
    Member
    Posted 1 year ago #

    Oops, forgot to mark topic as resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic