• Resolved glfoster

    (@glfoster)


    Hello,

    I’ve created a wp-query to show a custom display for my team. However, I can’t seem to only show a certain season.

    Here is my code

    `$player_query = new WP_Query(array(‘post_type’=>’wpcm_player’, ‘orderby’ =>’rand’, ‘post_status’=>’publish’, ‘posts_per_page’=>-1 )); ?>

    the season id is 574.

    What am I missing?

    Thank you,

    Glfoster

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Contributor Leon

    (@leonterry)

    Hi,

    You need to add a taxonomy query to your WP_Query.

    $args = array(
        'post_type' => 'wpcm_player',
        'orderby' => 'rand',
        'post_status' => 'publish',
        'posts_per_page' => -1,
        'tax_query' => array(
            array(
                'taxonomy' => 'wpcm_season',
                'field'    => 'term_id',
                'terms'    => 574,
            ),
        ),
    );

    Something like that should work.

    I hope that helps ??

Viewing 1 replies (of 1 total)
  • The topic ‘Team Page Template’ is closed to new replies.