Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Fancybox and result templating
This topic contains 3 replies, has 2 voices, and was last updated by jmjones328650 3 years, 1 month ago.
- AuthorPosts
- April 17, 2020 at 2:10 am #26785
Hi!
Me again 🙂 I have run into some problems and I really need some help. The problems I have are as follows:
1. Custom result templating: When using the
<?php echo $r->date; ?>
the output is ‘0000-00-00’. Is there an option change the date format so that it reads for example 14 April 2020?2. Custom result templating: Very much like the issue explained above, When using the
<?php echo $r->time; ?>
the output is returns a figure that includes seconds. Is there an option change this so that is just displays hh:mm?3. Integration with Fancybox: Third and final issue 🙂 I have Fancybox JS on my project that is used to open security incident reports that are custom posts as an iFrame. I have spent the entire night trying to find a solution that will incorporate Fancybox into the search results but I have had no luck. I have searched around and tried various different possible solutions, but I have had no luck.
Thanks again for your help!
April 17, 2020 at 2:39 am #26786UPDATE – Issue number 3 has been solved. All that was required was to insert:
$("[data-fancybox]").fancybox({ afterShow: function( instance, slide ) { } });
.
The other issues remain unsolved though 🙂
April 17, 2020 at 8:26 am #26793Hi,
1&2. Probably using the get_the_date() function is the best option here. It accepts the date format variables.
Something like:
<?php echo get_the_date('d F Y', $r->id); ?>
..and for the time:
Best,<?php echo get_the_date('H:i', $r->id); ?>
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 17, 2020 at 11:57 am #26794Hi Ernest!
Brilliant, works an absolute charm. Thanks so much!
- AuthorPosts
You must be logged in to reply to this topic.