Viewing 4 replies - 1 through 4 (of 4 total)
  • Zaphan58,

    You can call it anything you want as long as you put the following at the top of the .php page:

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

    You can check out the specifics here:

    https://codex.www.ads-software.com/Theme_Development#Custom_Page_Templates

    That help?

    You can also create a page called page-home.php and make sure to add this to the top of the file:

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

    Then go to Pages > Add New and apply the ‘home’ page template to it.

    You can name a custom page template anything you want, just use the page-custompage.php format and include that bit of php at the top.

    Edit – looks like marketermatt beat me to it. ??

    Thread Starter caffeinehigh

    (@zaphan58)

    Thanks guys!

    I have another question. I created the front page template as in the code below. But, within the page content it is displaying the comments link and posted on date etc. Comments are disabled and they don’t show on other pages, just the fron page that uses this template. Does the loop or something need editing?

    <?php
    /*
    Template Name: Page - Front
    */
    get_header();
    
    ?>
    
    <div id="contentwrapper">
    
    		<div>
    				<p class="front-statement">
    					Unique text for the static front page.
    				</p>
    		</div>
    
    	<div id="content">
    
    			<?php
    			/* Run the loop to output the posts.
    			 * If you want to overload this in a child theme then include a file
    			 * called loop-index.php and that will be used instead.
    			 */
    			 get_template_part( 'loop', 'index' );
    			?>
    
    	</div><!-- close content -->
    	<?php get_sidebar(); ?>
    </div><!-- close contentwrapper -->
    <?php get_footer(); ?>
    Thread Starter caffeinehigh

    (@zaphan58)

    Actually, forget my last post. I just realised I was a retard and copied the index file and not the page file into the new page template.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Static front page template’ is closed to new replies.