How to pass a category name in a link
-
Here is what I am trying to accomplish.
I have a page that has 2 links on it.
They go to two different categories of a custom content page
LInk 1 – Neighborhoods In Town
Link 2 – Neighborhoods Out of TownThe custom content is called “neighborhoods”
neighborhood categories are either “in_town” and “out_of_town”I have a single-posts page that runs a loop that displays the data for each custom post – this works great
I have a page (intown) that runs a WP_Query that displays all the custom content posts
– this page works correctlyMy question is this:
Instead of creating two pages – one for intown and one for out of town — how can set up the links to show results by category?for example:
when I click on the intown link – I want this to go to the intown page and display all the results for neighborhoods custom content with the category name of intown
and when I click on the outoftown link – I want this to to the intown page as well and display all the results for neighborhoods custom content with the category name of outoftown
and suggestions?
thank you!
- The topic ‘How to pass a category name in a link’ is closed to new replies.