简体   繁体   中英

header.php not including in custom page wordpress

Please make me correct where is the problem and what should i do,

i am trying to make my custom page template in wordpress. Also the default landing page,
What i did is, just created a file jp_home.php and set the Template Name: name here .

And then create a page with the name home and select the theme for the home page, second i went on the settings>reading> and select the a static page and select my home page as a landing page.

All these changes i have done in themes/twentyeleven/ template.

NOW the problem: in jp_home.php

<?php
/**
 * Template Name: WebTech Eleven
 */

//get_header('new');
?>

<!-- Wrapper Start -->
<div id="wrapper">
    Here is my Page
</div>
<!-- End Wrapper -->
<?php
    get_footer();   
//require("footer_old.php");
?>

after commenting the get_header() i am still viewing my header.php i don't know why?? and the rest part not visible. Can anyone please explain what wrong i have done?? ?>

Well if you still see the content from the header and none of the changes/additions in your jp_home.php then WordPress isn't pulling up that template file.

It sounds like you're doing everything you need to but lets just review how to accomplish what you're looking for.

Ensure that you have jp_home.php in the twentyeleven theme directory. With that in place, go ahead and create your Home page. Select WebTech Eleven under the Template option and save the page. After that, go to your Settings > Reading and make sure that your Front Page is set to display a static page, and set that to Home .

Make sure you are then actually navigating to the correct home page and you'll see the new template in action (a good way to do this is to navigate to edit your Home page and click "View Page"). I just tested all of this locally and it works for me.

Very clear and concise tutorial here also: http://wsmithdesign.wordpress.com/2011/01/19/creating-a-custom-wordpress-home-page-template/

Go to Pages -> All Pages and open the page you want to use the template on (THAT static page in your case). On the edit page, did you choose "WebTech Eleven" under templates?

Also, I must ask. Have you tried clearing cache on client side, and server side if you're using any cache there?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM