Skip to content

Instantly share code, notes, and snippets.

@99manish
Last active October 14, 2019 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 99manish/22aa31083859b81aaad80470fe335ed0 to your computer and use it in GitHub Desktop.
Save 99manish/22aa31083859b81aaad80470fe335ed0 to your computer and use it in GitHub Desktop.
Add last modified in course header
add_action('bp_after_course_header', function() {
global $wpdb;
$course_id = get_the_ID();
$data = $wpdb->get_results("SELECT post_modified_gmt FROM {$wpdb->posts} WHERE `ID` = $course_id", ARRAY_A);
echo '<div class="last_modified_date_of_course"> Last Updated On: '.date ( 'Y-M-d', strtotime($data[0]['post_modified_gmt'])).'</div>';
return;
},10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment