Support » Plugin: A-Z Listing » Use taxonomy to filter posts

  • Resolved openviewsnc

    (@openviewsnc)


    Hi Daniel,
    is it possibile to set the plugin in order to view only posts with a given taxonomy?
    If not, is there a way to enable this function, even paying for its development?

    Thanks,
    Nicola

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

    (@diddledani)

    The shortcode doesn’t support this functionality, but if you write a custom template into your theme you can achieve it by using the the_a_z_listing():

    the_a_z_listing( array(
        'post_type' => 'post',
        'tax_query' => array(
            array(
                'taxonomy' => 'taxonomy-slug',
                'field' => 'slug',
                'terms' => array(
                    'slug-of-term-within-taxonomy',
                    // any additional terms
                ),
            ),
        ),
    ) );

    The function the_a_z_listing() is compatible with WP_Query, so any of the parameters listed in the Codex should work the same way in this plugin. For taxonomy queries, see the taxonomy section of the WP_Query Codex page.

    I hope this helps..

    • This reply was modified 4 years, 11 months ago by Dani Llewellyn. Reason: fix syntax error (mismatched parentheses)
    Thread Starter openviewsnc

    (@openviewsnc)

    Thanks for your reply. By now I managed to obtain what I needed in another way: I filtered by taxonomy the posts to broadcast in my multisite, so the child blogs contain only the desired ones. Anyway I’m gonna mark your solution in case I’ll need it in the future.

    Regards,
    Nicola

    Plugin Author Dani Llewellyn

    (@diddledani)

    The shortcode has now gained the ability to filter by taxonomy terms in version 1.7.0:

    [a-z-listing taxonomy="taxonomy-slug" terms="term-slug"]

    You are free to add as many terms as you need separated by commas:

    [a-z-listing taxonomy="taxonomy-slug" terms="term1,term2,term3"]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use taxonomy to filter posts’ is closed to new replies.