Create Custom Post Type in WordPress, Query mySQL datatable to populate unique data on page.
Project detail
I need a custom post type created in wordpress called restaurants.
A datatable within mySQL will hold a list of restaurants and content/permalinks will be generated from the list.
Please see the table structure below.
name field and others will be used to generate the permalink
The permalink should look like this,
www.thewebsiteexample.com/restaurants/{primaryDesc}/{secondaryLocationDesc}/{name}
the img fields store static images to display on the unique page showing the restaurant info.
1 id Primary int
2 primaryDesc text
3 secondaryLocationDesc text
4 name text
5 foodType text
6 serviceType text
7 description text
8 priceRangeDescription text
9 restaurantLink text
10 imgTilePath text
11 imgCoverPath text
12 takesReservations tinyint(1)
The second data table only stores the hours for the restaurant. The id field from the first table will be used to query the hours table.
1 restaurantId int
2 DayOfWeek int
3 OpenTime time
4 CloseTime time
I am using a template for WordPress and you will need to create a restaurant detail page and also a restaurant list page to display this data with this template.
These data tables will be altered outside of Word Press, this means the pages will need to update accordingly.