Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14217 reviews 1686 hosting providers

Questions & Answers

Drupal / Display created date in my site’s search results

Sep 6, 2013 by Karen
Hi
I am using Drupal 7  and  I want to display the date a node was published in the search result, instead of the last modified date. Can anyone please help?
Thanks

1 Answer

0 votes
Sep 6, 2013 by expert
You can do this using hook_search_result() module to edit the search result  info and then process it in your theme from the function preprocess_search_result.
This might help
https://api.drupal.org/api/drupal/core!modules!node!node.api.php/function/hook_node_search_result/8