WordPress.org

Ready to get started?Download WordPress

Forums

Call specific category posts by tag (1 post)

  1. mura-
    Member
    Posted 3 months ago #

    Hi there,

    I'm building a new version for my blog and reorganizing category and tags structure.

    Through inspecting the website stats and finding out the way people behave while browsing it I've come to the realization that I've got to create something very specific.

    What I need is to call posts from categories using only specific tags. I'm not in a position where I can use subcategories, so I need to make the template behave so I can basically add a query where I can dinamically call all the posts under a category, but using a specific tag. (I.E. website.domain/category/tag/) I understand I could create *static* page templates with the code to call posts from cat=x which "has_tag=y" but since a large number of tags is involved that'd be crazy, so I need to do this "dinamically", by url (or link, for that matter)

    While I've not found a way to do this yet, I managed to think of an alternative way to query posts within a cat and specific tag, please tell me what you think of it and if I'm in the right direction here (or dead wrong...)

    I'm making a custom category.php with a new query. It will call the category using regular code args{'category'=> ID, ...} then I'll add tag argument, and while pretty permalinks won't let me add a tag variable through url, I can pass the tag using a _POST variable. tag => $_POST['taglink']

    As I said, given the amount of tags the site carries it'd be crazy to do this manually, so I'll change the way I display these links in my menus, automatically adding a form instead of a link for each tag styling them to look like simple a href hyperlinks.

    I searched the forum looking for a simpler solution, but I was unable to find anything related. Do you guys think i'm approaching the issue the right way? Did my post even make any sense to you at all? :S

Reply

You must log in to post.

About this Topic