Forums

[resolved] hyperlink to select post categories with URL (2 posts)

  1. amenitya
    Member
    Posted 3 years ago #

    I am using page category plus to categorize my wordpress pages. I have 18 pages, each categorized as a different food, e.g. oranges.
    Using the plugin, I am able to use get_the_category(); from each of my product pages. I was planning to use that value to generate a link on each page to recipes that contain that product using $category[0]->cat_nicename and passing that value to href.

    A small complication, however, is that "recipes with oranges" needs to link to a page with posts categorized as both "oranges" (id 14) and "recipes" (id 4). I was trying to see if both categories could be passed to the url - either by using the url structure itself (e.g. .../recepes/oranges) as suggested hereor by specifying the categories with php ( e.g. ?cat=4,14) but neither of those work.

    One strange thing I noticed is that *any* url that starts with "http://protogeo.info/wordpress_v2/" and ends with "arroz_valencia" (a category slug) will list posts in that category:
    http://protogeo.info/wordpress_v2/category/arroz_valencia
    http://protogeo.info/wordpress_v2/arroz_valencia
    http://protogeo.info/wordpress_v2/pig-latin-google-breath/arroz_valencia

    Is this an anomaly of k2? Any ideas on an approach to my problem
    would be ultra appreciated ;-).

  2. amenitya
    Member
    Posted 3 years ago #

    I still have no idea what was/is wrong with those paths, but I was able to solve my problem by creating a search results template page that gets variables from the product page to determine which posts to display.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.