Showing last update date in the listing details

This topic contains 2 replies, has 2 voices, and was last updated by  clem 6 years, 10 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #382227

    clem
    Buyer
    Post count: 87

    Hi Geodirectory team

    I’m just wondering if there is a way to show the last update date in the listing details ?

    Thanks

    Clem

    #382249

    Kiran
    Moderator
    Post count: 7069

    Hi Clem,

    Add following code snippet to your theme functions.php to display last modified on sidebar of the listing detail page.

    
    
    // Show last updated on listing detail page
    function gd_custom_modified_date_on_listing_detail() {
        global $post;
        
        if ( !empty( $post->post_modified ) && $post->post_modified != '0000-00-00 00:00:00' ) {
            $date = date_i18n( get_option('date_format'), strtotime( $post->post_modified ) );
            $time = date_i18n( get_option('time_format'), strtotime( $post->post_modified ) );
            
            $date_time = $date . ' @ ' . $time;
            
            echo '<div class="geodir_more_info geodir-last-updated" style="clear:both;"><span class="geodir-i-time"><i class="fa fa-clock-o"></i>' . __( 'Last Updated:', 'geodirectory' ) . ' </span>' . $date_time . '</div>';
        }
    }
    add_action( 'geodir_after_edit_post_link', 'gd_custom_modified_date_on_listing_detail', 20 );

    Kiran

    #382253

    clem
    Buyer
    Post count: 87

    Hi Kiran

    Works like a charm 🙂

    Thank you very much !!!

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket