• I have the custom code snippet to add the Last Updated Date in the functions.php but the only problem is that it shows up at the top of the post and I want it at the bottom of the post.

    How do I do that?

    • This topic was modified 4 years, 10 months ago by Jan Dembowski.
Viewing 2 replies - 1 through 2 (of 2 total)
  • It would help if you posted the code snippet, but you may find this useful in the meantime:
    https://wpdevelopers.com/adding-content-before-and-after-the_content/

    Thread Starter bigvibes

    (@bigvibes)

    @carike Here’s the code. I’m trying to change the code but still use my existing plugin code snippets to do it, thanks:

    function wpb_last_updated_date( $content ) {
    $u_time = get_the_time(‘U’);
    $u_modified_time = get_the_modified_time(‘U’);
    if ($u_modified_time >= $u_time + 86400) {
    $updated_date = get_the_modified_time(‘F jS, Y’);
    $updated_time = get_the_modified_time(‘h:i a’);
    $custom_content .= ‘<p class=”last-updated”>Last updated on ‘. $updated_date . ‘</p>’;
    }

    $custom_content .= $content;
    return $custom_content;
    }
    add_filter( ‘the_content’, ‘wpb_last_updated_date’ );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to move Last Updated Date to Bottom of Post’ is closed to new replies.