• I’ve created a new template file in my theme that consists of:

    <?php get_header(); ?>
    
    <p>Hello World</p>
    
    <?php get_footer(); ?>

    How would I link this page to my blog. When I link directly (href=”theme location/template) file I get an error.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Buca

    (@sharfeddin)

    Thanks as always Esmi. This method would be great, except for the fact that I will be distributing my theme to people who may or may not know WordPress, is there a way that page templates created by me could become active when my theme is activated? Am I making any sense?

    Thanks

    create your theme files (consisting of at least an index.php file and style.css)

    put these files in a folder with the name of your theme and copy the folder into your wp-content/themes folder.

    Your theme will then be available via the admin panel.

    Anyone you give your theme folder to can do the same on their wp blog.

    adding <?php get_header(); ?> in your index.php file will insert your header.php file in that place. If your theme does not have a header.php file in its folder it will use the header.php from the default theme. Likewise with all the other files.

    Thread Starter Buca

    (@sharfeddin)

    Miocene22, are you saying that in order to not have to set up additional pages from the backed I should create as sub theme inside my existing theme?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Linking to a custom template php file’ is closed to new replies.