List Custom Taxonomy Widget
[resolved] Link to a custom taxonomy (4 posts)

  1. Joshua
    Posted 3 years ago #

    How do I link to a custom taxonomy page?

    I've got the following:

    • Products (Custom Post Type)
    • Taxomony 1
    • Taxomony 2

    When I go to Taxomony 1 I still get all of the taxonomies.


  2. Nick Halsey
    Plugin Author

    Posted 3 years ago #

    Hmm, it should just link to the specific term page. Is the url something like example.com/taxonomy-1/term? Or are you trying to get just a listing of all of the terms in the taxonomy (or all of the posts applied to a term within a taxonomy)? I don't think it's possible to show a listing of everything within a given taxonomy, because that would be the equivalent of showing all posts that have any category or tag. Basically, you need to be linking to the pages for terms within each given taxonomy; this plugin adds a UI around that functionality in WordPress. So if you want "categories" specific to the products post type, you would create a single taxonomy assigned to that post type and assign terms to individual products.

  3. wptobbe
    Posted 3 years ago #

    I have a custom taxonomy applied to users which lets me divide users between different groups(terms). On taxonomy-{term}.php template I list all the users who belong to that term.
    Above the listing I want to have a dropdown with all the other terms, so when a visitor selects a term from that list and presses "go", then they should be taken to taxonomy-{term-a}.php and it the lists all the users in that group.

    However, when I use this plugin now i get this url http://www.domain.com/?taxonomy=http%3A%2F%2Fdomain.com%2Fauthor%2Ftaxonomy%2Fterm%2F

    The error only occurs when the terms are listed in a dropdown, not when they are a simple list. Will post my solution if i find one.

  4. Nick Halsey
    Plugin Author

    Posted 3 years ago #

    WordPress should redirect that url to the value of the taxonomy url parameter (the full link). The dropdown option requires using these redirecting URLs instead of direct links, but unfortunately there are issues with WordPress redirecting properly and there is poor documentation in the codex. See http://wordpress.org/support/topic/use-post_tag-no-page-found?replies=2. wp_dropdown_categories() just doesn't work very well; I'm considering just removing dropdown support from the plugin or putting in a warning.

    Either way, you don't want it to redirect to taxonomy-{term-a}.php, but rather http://domain.com/taxonomy/term, which will be using that php template if it's named correctly.

    By the way, I think you can probably accomplish what your trying to do much more efficiently with only a single taxonomy.php template, using the php to list the users...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic