• Resolved kmatoski

    (@kmatoski)


    Hello Markus,

    Thanks a lot for your great plugin.

    I have a list of posts (events) and I want to generate a form with a dropdown list of upcoming posts (events). For the date of event I am using custom field called ‘datum’. Now I am getting a list of all events, and I don’t need the past events in the list, only upcoming ones. I hope that this is possible?

    Best wishes, Klime.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Markus Wiesenhofer

    (@markusfroehlich)

    Hello kmatoski,
    for custom post queries you can use the “wpcf7_yourtag_get_posts” filter in your functions.php file.

    Here is an example:

    add_filter("wpcf7_yourtag_get_posts", "get_upcoming_event_posts", 10, 3);
    
    function get_upcoming_event_posts($post_args, $tag, $args)
    {
    	$post_args['meta_query'] = array(
    		array(
    				'key'     => 'past_events',
    				'compare' => 'NOT EXISTS',
    			),
    		)
    	);
    
    	return $post_args;
    }

    Best regards
    Markus

    Thread Starter kmatoski

    (@kmatoski)

    Hello Markus,

    Thanks a lot for your quick reply.

    Plugin Author Markus Wiesenhofer

    (@markusfroehlich)

    Hello Erik, no problem ??

    If you like my plugin, please give me a positive rating with WordPress-Page.

    Best regards
    Markus

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Dropdown list of posts after current date’ is closed to new replies.