Forums

Applying template to a page. (8 posts)

  1. raygunray
    Member
    Posted 3 years ago #

    I'm would like to apply a page template (products.php) to a partcular page /product-page/. I would like a navigation bar to appear only on a certain page: http://kudzuantiques.com/newKudzu/products-page/ . The rest of the pages will not have the special navigation.

    At one point, I thought applying a page template was as easy as selecting it from a drop down. Now I don't see it. Is it different for 2.7?

  2. lhoylhoy
    Member
    Posted 3 years ago #

    seems you already have your page file (products.php) open it then insert

    <?php /* Template Name: your template name
    */ ?>

    then on your dashboard add new page then on the right youll have a drop down list then select your template name

  3. raygunray
    Member
    Posted 3 years ago #

    I added the code before, but what I'm missing is the Apply Template Page. It's simply not there. It should be under Attributes.

    I have version 2.7.1.

  4. lhoylhoy
    Member
    Posted 3 years ago #

    i'm using 2.7.1 also but ive no problems with that. seems i can't do anything bout it anymore im sorry

  5. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Sounds like you may not have uploaded your page template to the correct folder. The Page Template dropdown doesn't appear until there is at least 1 customised page template in the theme folder.

  6. raygunray
    Member
    Posted 3 years ago #

    Here is what I have at the top of the products.php page:

    <?php
    /*
    Template Name: Categories
    */
     ?>
    
    <?php get_header(); ?>
    
    <?php get_sidebar(); ?>

    Still learning this PHP thing, but this looks correct. Did i put the Template Name in the wrong place or file?

  7. lhoylhoy
    Member
    Posted 3 years ago #

    ahah!!! try not to use categories try other terms,

  8. raygunray
    Member
    Posted 3 years ago #

    The issue wasnt the header. I deleted the comment area on my style.css in my theme. I had to redo the naming convention and it worked like a charm.

    Lesson learned: don't delete the comment area on your css or WP won't be able to find it.

    Thanks everyone.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.