0
votes

UPDATE:

I originally installed twentytwelve as my theme. The first thing I did was create a child theme and then installed the plugin headers and footers. I used this plugin to create my header and footer.

A tutorial said to place the custom template in the child theme directory. When I do this I have to indicate the proper path for form action as:

../wp-content/themes/twentytwelve-child/swaghome.php

when I do that the page is found but get_header() and get_footer() don't work. If I place the file in public_html then by changing the action to:

swaghome.php

everything works.

How can I keep my custom pages in my child theme folder and still have get_header() and get_footer() work?

Here's swaghome.php

<?php /* Template Name: swaghome */ ?>

<?php  get_header(); ?>

<div id="primary" class="site-content">
    <div id="content" role="main">

        <?php   


        if(isset($_POST["place"]) && 
           strcmp($_POST("place","foot"))==0)$place="foot";
        else if(isset($_POST["place"]) && 
           strcmp($_POST("place","involved"))==0)$place="involved";
        else $place="home";

        echo $place;

        ?>



    </div><!-- #content -->
</div><!-- #primary -->


<?php get_footer(); ?>

and here is style.css from child theme:

/*
Theme Name: Twenty Twelve Child
Theme URI: https://wordpress.org/themes/twentytwelve/
Template: twentytwelve
Author: the WordPress team
Author URI: https://wordpress.org/
Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device. Features include a front page template with its own widgets, an optional display font, styling for post formats on both index and single views, and an optional no-sidebar page template. Make it yours with a custom menu, header image, and background.
Tags: blog,one-column,two-columns,right-sidebar,custom-background,custom-header,custom-menu,editor-style,featured-images,flexible-header,footer-widgets,full-width-template,microformats,post-formats,rtl-language-support,sticky-post,theme-options,translation-ready
Version: 3.0.1568336488
Updated: 2019-09-13 01:01:28

*/
1

1 Answers

-1
votes

All right, if your create child-theme by tutorial than you can use your template with parent templates. If you haven't in child theme header and footer than they both will from parent theme.