Skip Navigation

[Resolved] Creating page for each state

This thread is resolved. Here is a description of the problem and solution.

Problem:
Creating page for each state

Solution:
How to display the related posts for state.

You can find the proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/creating-page-for-each-state/#post-1166821

Relevant Documentation:

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by fedeD-3 5 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1163168

Hi, I'm creating a business directory.
I've created a post type called "Company" whit these custom fields:
- company type (checkboxes)
- company name and description (text fields)
- company website, telephone number, email address
- company address with region and city dropdown selection

I've created a view to search the company based on Type, Region and City (hidden link).

I'd like to create a single page for each City, where I can list all the companies that have their headquarter in that city.
For example for the city Padova, I'd like to list of the companies.

Should I use a post relationships?

#1163594

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - I would like to know, City is configured as custom post type - correct? If yes, as I understand, you are looking to display the filtered results belongs to current city displayed using single city post. If yes:

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1164578

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I would like to know how you want to configure your city? As taxonomy or custom field or post type?

If you configure City as post type, then to connect it with other post types you need to create post relationship.

#1166821

Hi, at the end I created the city as post type and then I used post relationship.
In detail:
- I created a post type for the company (example: hidden link)
- I created a post type for the region (example: hidden link)
- I created a post type for the city (example: hidden link)

Then:
- I created a post relationship one to many (city and region)
- I created a post relationship one to many (company and region)
- I created a post relationship one to many (company and city)

+ Into the region page (example: hidden link) I have the possibility to list all the city (what I've done) and alle companies (maybe in the future).
+ Into the region page (example: hidden link) I can list all the companies filtered (with conditional output) for the type of company.
+ Finally I have the company page: hidden link