Add listing publishing date

Hi, I was wondering how I can add the date of when and advertisment was posted. Right now it only shows the date of when the user joined. Is there a snippet for this? or can I do it in the settings?

Kind regards,

1 Like

Please let me know which theme you’re using, the listing date appears in ListingHive but doesn’t for a few of our other themes.

Hi, I’m using TaskHive.

Kind regards,

Nicky Jowenko

Hi,

Please try this PHP snippet (How to add custom code snippets - HivePress Help Center):

add_filter('hivepress/v1/templates/listing_view_block', 'return_listing_created_date', 1000);
add_filter('hivepress/v1/templates/listing_view_page', 'return_listing_created_date', 1000);

function return_listing_created_date($template){
 return hivepress()->template->merge_blocks(
  $template,
  [
   'listing_details_primary' => [
    'blocks' => [
     'custom_listing_created_date' => [
      'type'   => 'part',
      'path'   => 'listing/view/listing-created-date',
      '_order' => 20,
     ]
    ]
   ]
  ]
 );
}

Please note that it can require further customization.
If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fvrr.co/32e7LvY

P.S. If you purchased a theme or extension, please enter the license key in the forum profile settings, this will enable the Premium Support badge and ensure a 24-hour turnaround time.

Alright thank you very much!