Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

add custom page to wordpress

// Create a custom page using template and link to php file 
--
Step 1 : 
/* Create a php file in your active themes root directory. 
(Idealy in a child theme!) */
page_name.php /* (generally good to use snake case or pascal case) */

Step 2 :
/* Inside you page_name.php file add this, */
<?php /* Template Name: any_name.php */ ?>

Step 3 :
/* Now you can create a wordpress page like normal and link it to that 
file by selecting a page template. (in the right sidebar by page options) 
The template name will be whatever you added in the for the snippet */
// <?php /* Template Name: any_name.php */ ?>
 
PREVIOUS NEXT
Tagged: #add #custom #page #wordpress
ADD COMMENT
Topic
Name
8+5 =