WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Pages (5 posts)

  1. badtourgirl
    Member
    Posted 4 years ago #

    Hello everyone... I am fairly new to style sheets and editing these crazy .php files - I have done a pretty exhausting search and I have not found anything that will help me -so I am hoping someone can assist me or point me in the right direction.

    I am trying to make additinal page templates - and have started off with the basics by creating them and pasting the code from my page.php so that I don't have to reinvent the wheel - but I am not sure what code I need to change.

    my site: badtourgirl.com and what I am trying to do is create a page for my photo galleries - so that when I click on pictures/or whatever I decide - the page template that will come up will be similar to the home page but the 7 picutres at the top.. just plain - so that I can put links to the multiply galleries.

    I am not even sure if it makes sense to do that - but would like to try it.

    Thanks for whatever insight you can pass along!

  2. zeniph
    Member
    Posted 4 years ago #

    hi not sure what your question is exactly..

    most important is to include at the very top of each new template you make is the code

    <?php
    /*
    Template Name: Photo page template or whatever you want to call it
    */
    ?>

    The template name will then appear under the template drop down for you to select.

    Theres nothing magic in the file page.php that you need to use. The existence of a file called "page.php" means that every page (not posts)(unless you've selected another template for it to use) will use page.php to display itself. If its not there wordpress will use the file index.php to display the page.

    hope thats of some help

  3. badtourgirl
    Member
    Posted 4 years ago #

    Sorry – I just re- read what I asked – and apparently I was drinking when I wrote it – as I t makes no sense at all. Sorry for the confusion.

    I have made another Page.PHP file - basically because I would like a couple of my subpages/child pages to look a little different than my main page.

    I have created the new subpage.php file and pasted everything from the original PHP file over and now I am trying to edit it - and this is where I am having no luck. As I am not sure what I need to edit to make the changes I want.

    I would like my child/subpages to be very similar to the front page but I don't want the sliding windows to be there. As these subpages will only have hyperlinks to various picture/video galleries on my site.

    So I just want the page to appear with the same colours and formatting and side bars but no sliding windows up top!

    Can that be done?

    Thanks! I hope this one made more sense.

  4. zeniph
    Member
    Posted 4 years ago #

    your new subpage.php will most likely contain a line of code that inserts the common header items (navigation etc):

    <?php get_header(); ?>

    It pulls in the file header.php. Duplicate header.php calling it say header-2.php (or whatever).

    In subpage.php replace the get_header code above with the following:
    <?php include( TEMPLATEPATH . '/header-2.php' ); ?>

    Within header-2.php find the code that makes the sliding nav and remove it (trial and error is good).

  5. badtourgirl
    Member
    Posted 4 years ago #

    awesome and that totally makes sense to me.
    Will try it out.

    Thanks so much!

Topic Closed

This topic has been closed to new replies.

About this Topic