Assalamualaikum...
Wanted to create a simple page that can quickly get a delivery quote for my customer~
Issue with Wordpress is most of the time need to fill up the address details before getting full quotation as im using a free plugin that is not so user friendly.
While I have manual quotation request incoming to our 4nutz social medias, i decided to spin up a tool page that help to quickly calculate the pricing.
ok today wanted to share first
How to create a page template in Wordpress theme?
Reason doing so is so that we do changes in the wordpress theme or the best is the child theme. not directly apply in database the code nor hacking the wordpress framework code! that is really hard and headache to maintain!
For those who dont know how to create Child Theme, please refer to this tutorial first!
Step one, create a php page file in Wordpress Theme/ Child Theme
vim page-distance-calculator.php
Step two, edit the php page, add the template details and include header, footer and content area.
<?php
/** Template Name: Page Delivery Calculator
*
* @package WordPress
* @subpackage Storefront Child
* @since Storefront Child 1.0
*/
?>
<?php get_header(); ?>
<div id="primary" class="content-area"><?php get_footer(); ?>
Step three, add php code / html
Step four, load in Wordpress page by creating a new page and load this new template in page attribute settings!
Walaah your page is done!
of course i did not include the delivery calculator code probably in next blog post!
Reference:
https://developer.wordpress.org/themes/template-files-section/page-template-files/
https://www.cloudways.com/blog/creating-custom-page-template-in-wordpress/
Comments
Post a Comment