Filter by advanced custom field.

Home Forums Welcome! Pre-Sales Questions Filter by advanced custom field.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #948216
    Joe
    Guest

    Hi there!
    First, thank you for this amazing Calendar.

    I tried to search in the forum before asking.. trying to see if there were similar questions.
    I found something, but it didn’t work.

    So I would like to ask you if you can guide in the right direction.
    I am aware you can’t give so much support for the “free” users.. but it worth a try. 🙂

    I need to have a page, which I can filter the results by the content of a custom field (created with ACF).
    for example using a dynamic address like : http://www.mydomain.com/events/?when=Summer
    where “when” is my custom field value.
    On the calendar admin side, when I create the events, I have the custom field “season”, and it’s a text-area, where I insert these keywords.
    Sometime in that field is present more than a season, separated by coma. (Summer, Winter)

    At the moment I have used this code :

    <?php 
    
    // args
    $value = $_GET['when']; // get value of selected choice.
    $args = array(
    	'post_type' => 'tribe_events',
        'posts_per_page'	=> -1,
    	'meta_key' => 'season',
    	'meta_value' => $value
    );
    
    // get results
    $show_events = new WP_Query( $args );
    ?>
    
    <?php
    
    if( $show_events->have_posts() ): ?>
    	<ul>
    	<?php while ( $show_events->have_posts() ) : $show_events->the_post(); ?>
    		<li>
    			<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><?php echo tribe_events_event_schedule_details( $event_id, '<p>', '</p>'); ?>
    		</li>
    	<?php endwhile; ?>
    	</ul>
    <?php endif; ?>
    
    <?php wp_reset_query(); ?>
    

    Now, it returns a LOT of events.. but totally ignoring my [ ?when= ].. and the start-event is totally messed up.

    This was my target.

    The plan B is to use your LIST event page.. with some modifications..
    But.. How can I filter your page using [ ?when= ] ?

    For me it’s totally same.. plan A or B..
    Plan B actually will work better.. because it’s written by you guys.. 🙂
    And I don’t have to implement pagination..order… etc etc..

    Thank you!
    Joe.

    #948254
    Barry
    Member

    Hi Joe,

    That’s a great question but you’re correct that we don’t offer quite as much support for free users as we do for those who have purchased a license – nor do we generally provide technical support here in the pre-sales forum.

    With that in mind, the best course of action here is either to buy a license and repeat your question in our PRO forum or else you can of course post in the community forums on wordpress.org and it’s quite possible a fellow user will be able to help 🙂

    Thanks again!

    #948806
    Joe
    Guest

    Hi Barry, thank you for your reply.

    I knew that… I have already tried to ask here for help in the past with the same results. I totally understand your point.

    At the end, I solved the problem by myself.. it took me one day more but at least, now I know something more about wp and your plugin.

    I have another question tho, but this one, I hope/think, you can answer :
    How can I export all my events? Is there a way from the dashboard ? (I have the free version of your plugin)

    Thank you.

    #948835
    Barry
    Member

    Hi Joe,

    You can export them using the regular WordPress exporter 🙂

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Filter by advanced custom field.’ is closed to new replies.