WordPress.org

Ready to get started?Download WordPress

Forums

Having a problem with Pages & seperate templates & stlyesheets (4 posts)

  1. lbitv
    Member
    Posted 8 years ago #

    I'm using the Radix WPG2 theme under WP2.01. I've created a Page with additional Pages as children of that Page (http://lbitv.com/sponsors/). What I'm trying to do is display those child pages with a different template & stylsheet from the main site/Pages. I've created a template for those pages & assigned it properly to each page, & created a seperate css file (style-sponsor.css), a copy of the original with a few tweaks ,for now,to be sure that the child pages are using the new stylesheet. I've tried using conditional tag in the main header to try & get the other pages to load the alternate style sheet, but that's not working & I'm in need of any assistance the good folks here can offer please. Thanks in advance

    my header file:
    lbitv.com header.php
    my page template file:
    lbitv.com page template "sponsors.php"
    my alternate stylesheet:
    lbitv.com alternate stylesheet "style-sponsors.css"

  2. mylagoon
    Member
    Posted 8 years ago #

    Create a template for what you want your page to look like (PHP file) and put this at the top:

    <?php
    /*
    Template name: PUT THE NAME YOU WANT HERE
    */
    ?>

    Upload that .php file into your themes folder.

    Then, goto Manage in WP-admin, select the page you want to have that template, click edit, and then in the right menu select from the drop-down list the template you just created. Voila.

    More info on this kind of thing can be found here:
    http://codex.wordpress.org/Templates

  3. Michael Bishop

    Posted 8 years ago #

    Why does your template have </*--?php get_header();--*/ ?> ?

    Perhaps the commenting out of the php is preventing the page from loading the header, which in turn is preventing the custom style sheet from loading.

  4. lbitv
    Member
    Posted 8 years ago #

    I am able to create the template file with no problem & have the other pages using it. It's the formatting of it that I'm having trouble with. miklb, I commented it out while experimenting with alternate ways of loading the stylesheet. When it is active it gives the default style.css, even though I've put a call for it in the header (recommended by Undersigned).

    <?php if(is_page()& $post->post_parent = '14') { ?> <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/style-sponsors.css/" type="text/css" media="screen" /> <?php } else { ?> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <?php } ?>

    I've also cleared out my cache to make sure that wasn't preventing the above code from working, but it still doesn't seem to be, it still pulls the original style sheet (style.css) & not style-sponsors.css.

    I'm also having problems with floating the copy block, but I assume that's because the main container is fixing the witdh, I hope to change this with the new stylesheet.
    Thanks again in advance for further comments & help

Topic Closed

This topic has been closed to new replies.

About this Topic