Timeline for Get date of last update outside of loop
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 4, 2016 at 0:46 | comment | added | BlueDogRanch | Ths is interesting; so how would one turn this into a shortcode to put into the page editor to show the last modified date of a page? I tried turning it into a shortcode with no luck `function last_modified_shortcode() { function wpse95769_modified_date_by_id( $page_id = 0, $format = "F j, Y" ){ global $page; $page = &get_post( $page_id ); setup_postdata( $page ); $modified_time = get_the_modified_time( $format ); wp_reset_postdata( $page ); return $modified_time; } } add_shortcode( 'last_modifed', 'last_modifed_shortcode' );' | |
S Jan 31, 2014 at 11:26 | history | edited | mor7ifer | CC BY-SA 3.0 |
Corrected error that printed out the date instead of returning it later.
|
S Jan 31, 2014 at 11:26 | history | suggested | lorem monkey | CC BY-SA 3.0 |
Corrected error that printed out the date instead of returning it later.
|
Jan 31, 2014 at 11:15 | review | Suggested edits | |||
Jan 31, 2014 at 11:26 | |||||
Sep 21, 2013 at 0:33 | history | answered | Stephen Harris | CC BY-SA 3.0 |