WordPress.org

Ready to get started?Download WordPress

Forums

Cat + Tag Filter
Templates for Category + Tag filter (18 posts)

  1. Xcellence IT
    Member
    Posted 1 year ago #

    Hey, this is what exactly I'm looking for. This works great. Thanks buddy.

    Did you tried for pretty permalink? And coming to an issue, do you have any idea what template will it pick? Any way to define template for some category + tag combination?

    http://wordpress.org/extend/plugins/cat-tag-filter-widget/

  2. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    Hi!
    I tried to use pretty permalink, but couldn't make it work. Looks like wordpress doesn't support this kind of links.
    I'm not sure, whether it uses category.php or tag.php, but according to this article http://codex.wordpress.org/Template_Hierarchy you can delete category.php and tag.php, then wordpress will use archive.php for category + tag combination.
    In archive.php you can use a condition like:

    if ( is_tag() && is_category()) {
        //do something only when category and tag were chosen
    }
  3. Xcellence IT
    Member
    Posted 1 year ago #

    Hey, thanks for your tips on template. I'll look into this.

    Any idea on pretty permalink or any hint how to do that. This is very important to have pages looked like a part of the site.

    I will be happy to pay you a fees if you can help us get this done.

    Thank you

  4. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    My plugin only generates a link and redirects user to that link. The rest is done by wordpress. So until wordpress doesn't support filtering posts with pretty permalink, I can't do that also...

    But, anyway how do you want links to look? Currently the look like this: site.com/?category_name=category1&tag=tag1,tag2
    I don't know how to make it pretty :)

    site.com/category/category1/tag/tag1/tag2 - like this?

  5. Xcellence IT
    Member
    Posted 1 year ago #

    Hey, thanks for your update.

    ite.com/category/category1/tag/tag1/tag2

    seems to be fine.

    I'll wait for your update. Thank you.

  6. Xcellence IT
    Member
    Posted 1 year ago #

    Hi,

    Have a looked at this page? http://codex.wordpress.org/Custom_Queries#Permalinks_for_Custom_Archives

    This might help.

  7. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks, I will look at it. But it looks too complicated for my skills.

  8. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    I don't think we can use two queries in one permalink.
    So the easiest way would be:
    -if only category was chosen, redirect user to standard wordpress url http://www.site.com/category/category1
    -if only tag, or two tags were chosen, redirect a user to standard wordpress url http://www.site.com/tag/tag1+tag2
    -if both category and tags selected, redirect to a custom permalink with only one parameter like http://www.site.com/filter/category1-tag1-tag2
    or even http://www.site.com/filter/category1-and-tag1-and-tag2

    There should be only one pair of key, value. In last case it is
    'filter' = 'category1-and-tag1-and-tag2' the word 'filter' can be anything else, but should be there.

    I don't know how to use two parameters in permalink, because actually "tag" and "category" are already can be used in permalinks, but not together. I think if there was an easy way to do that, wordpress would be doing it by default.

  9. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, http://thereforei.am/2011/10/28/advanced-taxonomy-queries-with-pretty-urls/ - this post has a manual on how to add to pairs of key=value in permalink. Will study.

  10. Xcellence IT
    Member
    Posted 1 year ago #

    Okay, rewrite rules with htaccess is always confusing for me. I'll wait for your response. And will also study these links.

    Thank you

  11. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    I have added the permalink support to a developer version 0.9.
    You can download it here:
    http://downloads.wordpress.org/plugin/cat-tag-filter-widget.zip

    Please test it and report if it works.

  12. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    oh, and don't forget to flush the redirection rules by going to permalink settings, changing them, saving and then changing them back to desired state (http://codex.wordpress.org/Rewrite_API/flush_rules).

  13. Xcellence IT
    Member
    Posted 1 year ago #

    hey, that's great. Thanks

    I'm going to test it tomorrow.

  14. Xcellence IT
    Member
    Posted 1 year ago #

    Hey, this works just fine with the category + tag, but doesn't work for the custom taxonomy... did you checked for this...

  15. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    What links does it generate? Does the currents stable version work with same custom taxonomies?

  16. Xcellence IT
    Member
    Posted 1 year ago #

    Hey,

    I have the custom taxonomy as type (content types, slug is type) where posts are organized using this like, News, Events, Reports, Research Papers, etc.

    I have changed custom taxonomy in widget section, and the url generated are like this.

    http://www.site.com/?category_name=science&type=reports

    This works fine.

    With permalink, it is generated as:
    http://www.site.com/category/science/type/reports

    And it takes me to the 404 page.

  17. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    The plugin should flush rewrite rules after options update, but I don't why - it doesn't :(
    So try to change your permalink structure and then change it back. Will it fix the problem?

  18. jimkimmons@gmail.com
    Member
    Posted 1 year ago #

    Just updated and got the 404 error. Didn't know what "flush" meant, but went to Settings > Permalinks and didn't change, just hit Save and all was well. Great Plugin for a site like mine: http://rockymountainplaces.com.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic