Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Date Filter

Viewing 10 posts - 1 through 10 (of 11 total)
  • Rai Uriarte
    #15270

    Hello Ross,

    One question.
    I´m using date picker with ACF and I want to display post that has “future” dates on the datepicker selection. I make the configuration on the options but anyway is showing up all the events of the custom post type.
    can you please check the configuration I made?
    You can see the image here: http://pasteboard.co/2CdgqzSL.png
    Thanks.

    Ross Moderator
    #15345

    Hi Rai

    This looks correct.

    In ACF, how are you storing your date fields? They must be stored as YYYYMMDD (I think ACF might represent this as YYMMDD)…

    Another way to test if the field is working correctly is to add a post meta field to the search form (date) and see if that brings up correct results.

    Just to note, you will get duplicate keys (_date and date) when creating fields in ACF, so try the other field just in case.

    Thanks

    Rai Uriarte
    #15355

    Thanks Ross,
    I try adding the post meta to test and is not working so the date is not properly set.

    This are the options that ACF gives me:
    http://pasteboard.co/2EGdvIFW.png

    The one that I should change is the “return format” right?
    I try YYYYMMDD YYMMDD Ymd
    But does not work, either for the post meta or for the or for the general settings post meta.

    Also I realize that the only way that the function of ACF to print the date correctly is when I use Ymd on ACF otherwise the result is just the actual date.

    I will appreciate your suggestions to keep testing.

    Thanks.

    Ross Moderator
    #15357

    Hi Rai

    For return format you should choose “20150418”.

    This will then save the dates in the correct format in the database.

    I think when you change this setting, ACF doesn’t automatically update all the dates to the correct format, so you would probably have to re-save the dates – try adding a few new dates to your posts after you have updated this setting.

    Let me know

    Thanks

    Rai Uriarte
    #15367

    Thanks Ross,

    I was thinking the same, I try that and it does not work either.
    I have the intuition that I´m missing something…
    The archive page where the search form loads is in a custom post type, it has a loop with a variable that only add a class.

    <?php if( have_posts()) :while( have_posts()) :the_post(); ?>
    			    <?php if ( get_post_status ( get_the_ID() ) == 'future' ) {
    			    
    				        $class = 'evento-futuro';
    				    }
    				    
    				    else
    				        $class = 'evento-pasado';
    				
    				?>
    				<div class="<?php echo $class;?>">
    				    <?php get_template_part('content-eventos'); ?>
    				</div>
    				<?php endwhile; ?>

    I´m bringing the search form into the sidebar with the shortcode, even when I have selected the option to show it on a template and not with shortcode. That has been working excellent.

    I feel I´m doing something wrong in the templates, not sure what.

    Also, I´m doing it on my localhost, that may be interfering in something?. But even when I try to do it live it does not work.

    Ross Moderator
    #15368

    Hi Rai,

    If Search & filter is working fine EXCEPT for when searching for dates in the future (in the “post meta” tab), then I think the problem likely has nothing to do with your template/theme and everything to do with this specific post meta.

    I’ve just done a test locally – using latest ACF & S&F and created new fields & posts and it is working fine. I don’t think there is a bug rather a misconfiguration issue.

    I would start from scratch as a test,. create a new date field (and configure the correct format, apply it to some posts, then create a test search form with just this date field and see if it works!

    Thanks

    Rai Uriarte
    #15674

    Hello Ross,

    Can you kindly share with me screenshots of ACF date format, and S&F post meta configuration that you use to test it?. Still not working for me.

    Rai Uriarte
    #15676

    Hi Ross,

    I have a little advance.

    I discover that when I set S&F to be display using the shortcode mode then all works fine.

    When I use the Archive page mode, does not work properly, it brings old and future events.

    When I use the archive page mode it will bring ok the future events when I search them with the post meta filter. But as I set the Post Meta pre filter of Only return results which match specific post meta data. It will bring only future and not old posts when I search for them, and that is ok but the problem is that in the normal view of the archive page or event page it brings old and future at the same time, not making the pre filter.

    For me it will be ok to use the shortcode method but, I need to add custom fields to the loop, to be shown on the results. How should I edit the_content to add it the special CF to the results?. I will need to add a condition to the normal loop to show this fields when is this special page or other?.

    Thanks!.

    Rai Uriarte
    #15681

    Hi Ross,

    🙂
    I got it!
    It was about the archive…
    I was wrong with the configuration to display the search form.
    I have selected the archive page but at the same time also the custom template with the same name of the archive, so every time will bring the archive causing to display all the events.

    Now, I duplicate the archive-eventos.php, I change the name, I put it on the display options, also I set the slug to “eventos” and now is working fine.

    I hope this can help others.

    PD: I knew it was related to the template. hahaha.

    Rai Uriarte
    #15687

    This is where it is now with future events:
    http://www.comunidadkundalini.com/eventos/

    This is the archive, past events:
    http://www.comunidadkundalini.com/archivo-eventos/

Viewing 10 posts - 1 through 10 (of 11 total)

The forum ‘Search & Filter Pro’ is closed to new topics and replies.