WordPress.org

Ready to get started?Download WordPress

Forums

How to delete default template - seem to have ended up with a duplicate (2 posts)

  1. Emma_W
    Member
    Posted 7 months ago #

    Hi,

    I'm using the Toolbox theme for WordPress on the website http://host26.qnop.net/~fpsl/ and don't want to use the default sidebar template, but rather for the full-width template to be the default for every page. I've overwritten page.php with the full-width template, but now have two templates referred to as 'Default template' in the dashboard, both of which appear to be the same. If I change the description for the new full-width default template (say to 'new template') then both 'new template' and 'default template' appear in the dashboard.

    How do I get rid of this duplicate template? Any advice would be much appreciated - this is a client website and I am keen to avoid the confusion of multiple default templates being available in the dashboard.

    Best wishes,

    Emma

  2. paulwpxp
    Font hero
    Posted 7 months ago #

    You might already have this but just to be sure. When copy over content from full-width-page.php to the page.php, do not include the Template Name: declaration at the top comment block.

    So the content in the page.php will be this

    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * @package Toolbox
     * @since Toolbox 0.1
     */
    
    get_header(); ?>
    
    		<div id="primary" class="full-width">
    			<div id="content" role="main">
    
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php get_template_part( 'content', 'page' ); ?>
    
    					<?php comments_template( '', true ); ?>
    
    				<?php endwhile; // end of the loop. ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php // get_sidebar(); ?>
    <?php get_footer(); ?>

    So the above will make the default page template become full width one.

    Regarding the not having Page Template appear in page attributes dropdown, there is no way to do that (within my knowledge). Maybe we could add in the admin CSS to display none that part, but it's not worth the effort. Since this is your edited version of the theme, it's better to just delete that full width page template.

    Be sure to have a backup of theme files and make a changelog to help remember what to do when theme updates.

Reply

You must log in to post.

About this Topic