How to convert a site into WordPress

burnedfaceless
burnedfaceless used Ask the Experts™
on
I want to rebuild a site I built a long time ago in WordPress.

I'm wondering how to create the prices and availability page in WordPress https://www.effinghamministorage.com/prices/

Do I just paste the HTML into the text section of a page editor? And add the JavaScript somewhere (like the theme's footer?)?

Also the availability is stored in a database and updated via an admin page that has HTML number inputs. Can you tie the availability into the WordPress backend?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Developer & EE Moderator
Fellow 2018
Most Valuable Expert 2013
Commented:
You can do this by creating a shortcode in your functions page or by creating a plug in.

To create a short code it will look like
add_shortcode( 'uniquename_prices', 'uniquename_prices_func' );
function padas_weekly_schedule_func( $atts ){


    $html = "<div class='col-sm-12'>";
    $html .= "<p>Hello World</p>";
    $html .="</div>";
	return $html;
}

Open in new window


Now on any of your wordpress posts or pages add below in the editor to get, "Hello World"
[uniquename_prices]

Open in new window


Now take that a step further
add_shortcode( 'uniquename_prices', 'uniquename_prices_func' );
function padas_weekly_schedule_func( $atts ){

include_once $_SERVER["DOCUMENT_ROOT"].'/path_to/your_custom_php/uniquename_prices.php';

    $html = getMyPrices();

	return $html;
}

Open in new window


On your uniquename_prices.php you can create php code that you are familiar with to generate the html that pulls from your database. Wrap your output in a function called getMyPrices(); or whatever you want. This keeps the output in scope. If you created a page that didn't use a function, you would not have control of were the output shows up on your page or even which page it outputs to.

Author

Commented:
Thanks man, that was an excellent response.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial