Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    Are you displaying a list of terms from a taxonomy, or are you wanting to filter a list of posts by excluding any posts who have the term in question?

    For the first, displaying a list of terms from a taxonomy, it is currently not possible to filter the list in any way (unless I’ve forgotten about it, which is entirely possible ?? ).

    If you are displaying a list of posts and wish to exclude posts who have a specific term assigned, then this is possible via PHP, but not via the shortcode. For excluding via PHP you would recite the magic words:

    the_a_z_listing( array(
        'post_type' => 'your_post_type',
        'tax_query' => array( array(
            'taxonomy' => 'your-taxonomy', # this is a taxonomy slug
            'field' => 'slug', # this says that we're using slugs in the 'terms' array below
            'terms' => array( 'your-terms' ), # these are term slugs and any number of them are allowed
            'operator' => 'NOT IN',
        ) ),
    ) );
    
    Thread Starter leo6912

    (@leo6912)

    Hi,

    Where can i paste the PHP code? Do i need to make a new custom page template with the code snippet?

    Plugin Author Dani Llewellyn

    (@diddledani)

    The code needs to be added to an appropriate template in your theme. The template-hierarchy page and image are helpful to determine an appropriate file to add or modify.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude certain category’ is closed to new replies.