Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #649084

    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

    • This topic was modified 8 years, 5 months ago by Volli.
    #649833

    Hey Volli,

    Can you please post the link to your page where you would like to make the changes?

    Best regards,
    Yigit

    #650797

    Hello Yigit,

    see private content.

    Thank you
    Volli

    #651478

    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

    #652399

    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

    #653157

    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

    • This reply was modified 8 years, 5 months ago by Yigit.
    #653330

    Thank you very much. Works perfect.

    #653336

    Hi,

    You are welcome! Let us know if you have any other questions or issues!

    Best regards,
    Yigit

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘timestamp on posts and portfolio’ is closed to new replies.