This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Fancybox and result templating

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Fancybox and result templating

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26785
    jmjones328650jmjones328650
    Participant

    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!

    #26786
    jmjones328650jmjones328650
    Participant

    UPDATE – 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 🙂

    #26793
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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:

    <?php echo get_the_date('H:i', $r->id); ?>

    #26794
    jmjones328650jmjones328650
    Participant

    Hi Ernest!

    Brilliant, works an absolute charm. Thanks so much!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.