• Resolved tactics

    (@tactics)


    Question:

    I need to create a site that has three different categories of posts (like “planes”, “trains”, and “cars”). Each one of these needs to have a color, and a year.

    When a user goes to the “planes” category archive, it should display all of the planes by default, and there should be two drop downs – “color” and “year”. If they select “red”, it should show all the red planes, if they select “red” and “2013”, it should only display planes that are that color and year.

    Is it possible to create a filter for those custom taxonomy terms, that only searches within the post’s parent category? In other words, can I create a drop down on the archive page of the planes category that pulls up all the red planes, but not the red cars?

    https://www.ads-software.com/plugins/beautiful-taxonomy-filters/

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

    (@jonathandejong)

    Hi Tactics,

    With this plugin as is right now you cannot do this. BTF are not able to just show those two dropdowns (color and year) when on a term archive of a different taxonomy (type).

    It would be pretty complicated to implement into the plugin since it has to be generic enough to work with any combination of situation and also let you choose wether this is the desired behaviour (most people want to show all taxonomies regardless).

    However you could probably achieve this yourself by adding some dropdowns of your own on a term archive and throw them in as GET parameters if they do a filtering. Then you’d have to use the pre_get_posts filter in WordPress to see if those GET parameters exists and modify the wp_query accordingly.

    As you can see it’s not even that easy to do for your own specific situation and even worse when implementing it into a plugin that should work for everyone ??

    Thread Starter tactics

    (@tactics)

    Plugin Author Jonathandejong

    (@jonathandejong)

    No problem,

    Yes there are plenty of other a bit more versatile filtering plugins out there.
    The point of BTF is not to compete with those but rather to offer a lightweight, WP core-based and more SEO friendly alternative ??

    Best of luck in your project!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filter only within specific category?’ is closed to new replies.