Hello all,
I would like to have a “created at”- and a “last modified”-timestamp displayed somewhere on my posts and portfolio’s.
Is this possible ?
Thank you
Volker
Hey Volli,
Can you please post the link to your page where you would like to make the changes?
Best regards,
Yigit
Hello Yigit,
see private content.
Thank you
Volli
Hi,
Please add following code to Functions.php file of your child theme
function avia_last_mod(){
$output = "
Last modified: ". get_the_modified_time(get_option('date_format')) ."
";
return $output;
}
add_shortcode( 'last_mod', 'avia_last_mod' );
then edit your post and add [last_mod] shortcode where you would like to display the date
Best regards,
Yigit
Hi Yigit,
yes, that’s exactly what I want. Thank you very much.
What about created at ? Is there a already a exsisting shortcode or have I to create a function and shortcode similar to the above?
Kind regards
Volli
Hi,
Please add following code to Functions.php file as well
function avia_post_created(){
$output = "Created: ". get_the_date( $format, $post_id ) ."
";
return $output;
}
add_shortcode( 'avia_created', 'avia_post_created' );
and then use [avia_created] shortcode :)
Best regards,
Yigit
Thank you very much. Works perfect.