Forums

Is this a bug? Can someone please help me get additional templates wiorking? (12 posts)

  1. stanwelks
    Member
    Posted 2 years ago #

    I have spent hours trying to figure this out and can not get what should work to work.

    I have created a Word Press theme and I want to now create an additional template that I can use for different pages across my WordPress site.

    Here is what I have done:
    - I create a copy of my page.php and renamed it
    - I placed this code at the very top of the page:
    <?php
    /*
    Template Name: new template
    */
    ?>
    - I uploaded this file into my theme folder

    1. The new template is not available to me to choose from in the drop down list when you add a new page or edit existing pages.

    2. As a matter of fact, I only see the drop-down to change the template for a page when I use Quick Edit for a page. I do not see this drop-down on the create a new page or edit a page.
    Under the "attributes" section in Quick Edit, there is an area for Parent and Order. The drop down directly below Parent includes a listing of my existing pages, not templates.

    Am I Doing something wrong?

    Thanks for any help!!!!

  2. songdogtech
    Member
    Posted 2 years ago #

    Switch to the default theme for a second and switch back to the theme with the custom template and see if a template dropdpown now appears in Attributes.

  3. stanwelks
    Member
    Posted 2 years ago #

    Do you mean to go to Appearance > Themes and select the first theme that appears? I am not sure which is the default theme. I have never switched themes before. Will it easily go back to the way it was when I re-select my theme after selecting the default one?

    Thanks!!!!

  4. songdogtech
    Member
    Posted 2 years ago #

    Yes and yes. It only takes two seconds to switch themes.

  5. stanwelks
    Member
    Posted 2 years ago #

    That took care of it!!!! Thank you so MUCH. I have spent hours trying to get this to work.

    1.) Is this a bug with my install or why did this happen? Is it anything I need to be concerned with, with regards to my install?

    2.) How do I now remove the widgets that display on all of my other pages from this new template page?

    Thank you!!!!1

  6. songdogtech
    Member
    Posted 2 years ago #

    Not a bug; just sh*t happens. When you Edit the Widget, there's a Remove button.

  7. stanwelks
    Member
    Posted 2 years ago #

    I do not want to remove the widgets from the pages they are already on. I just want to remove them from the new pages I just applied this new template to.

    Thanks!

  8. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    I think you have to make a new sidebar, like sidebar2.php and call to that sidebar instead of your normal in that page template then

  9. stanwelks
    Member
    Posted 2 years ago #

    Would simply removing this:

    </div>
    <?php include (TEMPLATEPATH . '/sidebar1.php'); ?>
    </div>

    remove the widgets from this template page?

    Thanks!

  10. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    if that is how your sidebar is called in, then yeah that'll do it!
    On mine it would be <?php get_sidebar(); ?>

    watch out for those </div> closing tags tho.....Don't delete any closing tags unless you are also deleting the openings

  11. songdogtech
    Member
    Posted 2 years ago #

    You might have to make a new sidebar, as Rvoodoo says. But then test your site in different browsers and use the The W3C Markup Validation Service to be sure your code is accurate and the site displays correctly.

  12. stanwelks
    Member
    Posted 2 years ago #

    Thanks guys for all your help!!!!

    I will try the different ways out and post back here. :-)

Topic Closed

This topic has been closed to new replies.

About this Topic