Support

Account

Home Forums General Issues Filter category list Reply To: Filter category list

  • Hi,

    I’m not sure what you’re asking/doing, but I think you should use the proper WordPress way to set this up.

    Create a custom post type (Movies), then create a custom taxonomy (Genres), connect the taxonomy to the custom post type. You can use the CPT UI plugin for this, this Movies&Genres is literally the suggested example when you create your first CPT & Taxonomy.

    Once you have this connected, you will automatically get “checkboxes” under your Movies posts and you can set your genres per movie.

    When you want to loop trough a Genre, just use a WP_Query that filters by custom taxonomy. Here’s an example of that code:

    $args = array(
        'post_type' => 'movies',
        'tax_query' => array(
            array(
                'taxonomy' => 'genres',
                'field' => 'slug', //can be set to ID
                'terms' => 'action' //if field is ID you can reference by cat/term number
            )
        )
    );
    $query = new WP_Query( $args );