• Resolved emilygw

    (@emilygw)


    Hello, thank you for your help!
    My copyright footer is saying 2018, not 2021.
    The code I have used is:

    add_action( ‘init’, ‘custom_remove_footer_credit’, 10 );

    function custom_remove_footer_credit () {
    remove_action( ‘storefront_footer’, ‘storefront_credit’, 20 );
    add_action( ‘storefront_footer’, ‘custom_storefront_credit’, 20 );
    }

    function custom_storefront_credit() {
    ?>
    <div class=”site-info”>
          © <?php echo get_bloginfo( ‘name’ ) . ‘ ‘ . get_the_date( ‘Y’ ); ?>
    </div><!– .site-info –>
    <?php
    }

    Everything seems to be up to date and the timezone/date format is correct.
    Any ideas?
    Thanks again,
    Emily.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @emilygw,

    I believe that’s going to pull the year the site started instead of the current date. I changed the function to use PHP’s date() instead of WordPress’s get_the_date().

    
    add_action( 'init', 'ijab_remove_footer_credit', 10 );
    
    function ijab_remove_footer_credit () {
        remove_action( 'storefront_footer', 'storefront_credit', 20 );
        add_action( 'storefront_footer', 'ijab_custom_footer_credit', 20 );
    }
    
    function ijab_custom_footer_credit() {
        ?>
        <div class="site-info">
    		<p>&copy; <?php echo date( 'Y' ) . ' ' . get_bloginfo( 'name' ); ?></p>
        </div><!-- .site-info -->
        <?php
    }
    

    On my test site that appears to work.

    date

    Thread Starter emilygw

    (@emilygw)

    Thank you! @3sonsdevelopment
    Perfect – I am so grateful for your help and expertise.
    Best wishes,
    Emily.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Y is showing wrong year’ is closed to new replies.