Timeline for Need help to structure our a complex hierarchy
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 7, 2017 at 8:49 | comment | added | Benoti | If you are talking about pregetposts, the best is on functions.php. | |
Jan 7, 2017 at 0:54 | comment | added | Alex | Ok so Ive created a hierarchal taxonomy for Places (with continent > Country > City). Ive also created a custom archives Page (Places_Archive.php) So now I am confused about where I put the query exactly in my code. | |
Jan 6, 2017 at 23:04 | comment | added | Benoti | I don't think you should create taxonomy page for each country, where pre_get_posts can handle all logic. You can have different pregetposts for each custom tax. | |
Jan 6, 2017 at 22:48 | comment | added | Alex | So I also have the option to create a Page for every country and every city, which would result in hundreds of pages. And in those pages I could filter manually using tags the content for food, restaurants, etc. Would this be bad practice? By building a taxonomy for 1. continent 2. country 3. city I could create logic with the wp_query that would pull the posts sorted by the logic that i choose (categorized by food, restaurants, etc. for that location) is this correct? | |
Jan 6, 2017 at 22:09 | comment | added | Benoti | To create taxonomy page you just need to copy and rename the default tax or archive page of your theme, and in this file you can call any template part ie content-city.php. read more about the template hierarchy could be great developer.wordpress.org/themes/basics/template-hierarchy | |
Jan 6, 2017 at 21:25 | comment | added | Alex | Thanks for this info. That definitely helps. I will give this a try now. Once I have created a taxonomy for the places, then how can I create an archive page that functions the same way as the "/category/" archive pages. Can I build a page using ordinary page builder on wordpress, and somehow make this the standard format for all /Continent, /Country, and /City pages? | |
Jan 5, 2017 at 23:44 | history | answered | Benoti | CC BY-SA 3.0 |