Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter jonodesign

    (@jonodesign)

    Figured it out through reading the wp_query codex – https://codex.ww.wp.xz.cn/Class_Reference/WP_Query.

    Basically all I needed to do was set a variable that captured the page title – which is either Monday, Tuesday, Wednesday, etc – then use the variable in arguments like so:

    $title = get_the_title();
    $args = array(
    ‘numberposts’ => -1,
    ‘post_type’ => ‘activities’,
    ‘post_status’ => ‘publish’,
    ‘meta_query’ => array (
    array (
    ‘key’ => ‘day’,
    ‘value’ => $title,
    ‘compare’ => ‘IN’
    )
    ) );

    It’s always nice to work it out by yourself!

    John

Viewing 1 replies (of 1 total)