[resolved] Body tag editing (2 posts)

  1. Corsair66
    Posted 1 year ago #

    I need to insert this comment before the </body> tag on my site's main page:

    <!-- Last Update: <?php echo date("d/m/Y"); ?> -->

    The idea is to auto-update the date whenever a new comic is posted.

    Which file must be edited to insert this comment? I've looked without success; I must've passed right over it - any assistance would be greatly appreciated!



  2. Frumph
    Theme Author

    Posted 1 year ago #

    add_action('wp-head', 'mytheme_last_update');
    function mytheme_last_update() {
        if (is_home() || is_front_page()) {
             echo '<!-- Last Update: '.date("d/m/Y").' -->'."\r\n";

    Add that to your child themes functions.php file or your main themes functions.php file

    ..but that will post the current date, though.. not the one of the latest comic.. if you want latest comic; would need to write a loop for you to get that info

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic