- Sep 22, 2013
- 1,209
- 1,670
Hey Guys!
I'm building a WordPress site now and I need more functionality on it than just the vanilla WordPress features. I searched around the plugins repo and can't find anything that matches to my requirement.
The feature I need is to pull random column data from the Wordpress Database and display it on the WordPress page and I need it done via the shortcode using php on custom page template.
I've found some great articles like the one below to get it done.
Let's say I need to display a shop's address and contacts from a city, I'd have the address and contact details in the database and I need it to be displayed on whatever page I create when I add this shortcode to the page.
[shortcode Nottingham]
Another feature I need is to display 2 tables for each city and have some information generated dynamically next to the table.
For ex, let's say I add [shortcode Sheffield to Liverpool] to a page; It should display data in the following format.
____________________________________________________________________________________________
|Sheffield | Liverpool | The next shop is located on Liverpool, 77.1 miles from Sheffield
|
|Address | Address
|##### | #####
|##### | #####
|Contact : x | Contact : Y
|Staff Nos : 10 | Staff Nos : 8 | The Liverpool shop have 20% lesser staffs than the Sheffield shop.
|___________________________________________________________________________________________
All the data's are there in the table except the highlighted 20% and it should be generated dynamically by comparing two numbers that we have for the Sheffield and Liverpool as it'll be different for each city.
Can anyone please shed some light on what functions should I use to make it work?
I know I can simply pay someone to get his done but I'd really like to see it work through my hands.
P.S. I can work with the css classes to format the data. I only need help with pulling the data from the table and generating the dynamic numbers by comparing 2 integers for the selected cities.
Thanks a bunch in Advance!
I'm building a WordPress site now and I need more functionality on it than just the vanilla WordPress features. I searched around the plugins repo and can't find anything that matches to my requirement.
The feature I need is to pull random column data from the Wordpress Database and display it on the WordPress page and I need it done via the shortcode using php on custom page template.
I've found some great articles like the one below to get it done.
Code:
http://www.whatmarkdid.com/php/displaying-data-custom-table-wordpress/
Let's say I need to display a shop's address and contacts from a city, I'd have the address and contact details in the database and I need it to be displayed on whatever page I create when I add this shortcode to the page.
[shortcode Nottingham]
Another feature I need is to display 2 tables for each city and have some information generated dynamically next to the table.
For ex, let's say I add [shortcode Sheffield to Liverpool] to a page; It should display data in the following format.
____________________________________________________________________________________________
|Sheffield | Liverpool | The next shop is located on Liverpool, 77.1 miles from Sheffield
|
|Address | Address
|##### | #####
|##### | #####
|Contact : x | Contact : Y
|Staff Nos : 10 | Staff Nos : 8 | The Liverpool shop have 20% lesser staffs than the Sheffield shop.
|___________________________________________________________________________________________
All the data's are there in the table except the highlighted 20% and it should be generated dynamically by comparing two numbers that we have for the Sheffield and Liverpool as it'll be different for each city.
Can anyone please shed some light on what functions should I use to make it work?
I know I can simply pay someone to get his done but I'd really like to see it work through my hands.
P.S. I can work with the css classes to format the data. I only need help with pulling the data from the table and generating the dynamic numbers by comparing 2 integers for the selected cities.
Thanks a bunch in Advance!