• Resolved candell

    (@candell)


    I initially set up the plugin on my custom post type archive page and using the basic loop

    <?php do_action('show_beautiful_filters'); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    etc etc

    and this worked great.

    However I want to modify the query to run off a date field I set with Advanced Custom Fields

    <?php do_action('show_beautiful_filters'); ?>
    <?php 
    $timecutoff = date("Yjd");
    $args = array(
    'post_type' => 'sc_jobs',
    'orderby' => 'meta_value',
    'meta_key' => 'closing_date',
    'meta_compare' => '>=',
    'meta_value' => $timecutoff,
    'order' => 'ASC'
    );
    $my_query = new WP_Query($args);
    			
    if ($my_query->have_posts()) : while ($my_query->have_posts()) :
    $my_query->the_post();
    ?>

    How do I pass to beautiful taxonomy filters my new query $my_query?

    Thanks

    • This topic was modified 9 years, 7 months ago by candell.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom query’ is closed to new replies.