WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Alternate Stylesheet for One Page!!! (11 posts)

  1. ragmag
    Member
    Posted 7 years ago #

    I read through the forum looking for an answer to get my template to read an alternate stylesheet and I'm still stuck! I read this: http://wordpress.org/support/topic/89953.
    And created an alternate stylesheet called "style2.css". I copied the stylesheet for my frontpage and created "basic.css". In "style.css", I wrote :

    /*
    Theme Name: Quadruple Blue
    Theme URI: http://www.wpdesigner.com/2007/01/26/quadruple-blue/
    Description: Quadruple Blue WordPress theme created by Small Potato for WordPress 2.0 series.
    Version: 1.0
    Author: Small Potato
    Author URI: http://www.wpdesigner.com/

    Released under GPL.

    */
    @import "basic.css";
    @import "style2.css";

    In header.php and header2.php (for my page template) I retained the call:
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    Because any time I tried to change the href to "http://mysite.com/style2.css" it never worked.

    HOW DO I GET THE PAGE TEMPLATE TO READ MY ALTERNATE STYLESHEET? I'm sure the answer will be really simple.

  2. Jonathan Landrum
    Member
    Posted 7 years ago #

    Why all the hassle? I just use the default stylesheet call, and then after that I put a boolean PHP call:

    <?php if ( is_single('123') ) { ?>
    <link rel="alternate stylesheet" href="/style2.css" type="text/css" media="screen" />
    <?php } ?>

  3. ragmag
    Member
    Posted 7 years ago #

    I changed your code to this:

    <?php if ( is_page('6') ) { ?>
    <link rel="alternate stylesheet" href="/style2.css" type="text/css" media="screen" />
    <?php } ?>

    tried adding it to 'style.css', 'header2.php' and 'themag.php' and it didn't work.
    am I missing a step?

  4. Jonathan Landrum
    Member
    Posted 7 years ago #

    Just put it in the header.php file where the stylesheet call should go. If that's the only difference between header and header2, then get rid of header2.

  5. ragmag
    Member
    Posted 7 years ago #

    ok when I put:

    <?php if ( is_page('6') ) { ?>
    <link rel="alternate stylesheet" href="/style2.css" type="text/css" media="screen" />
    <?php } ?>

    in header.php I got this error message:

    Parse error: parse error, unexpected $ in /home/content/r/a/g/ragmagger/html/wp-content/themes/quadruple-blue/quadruple-blue/header.php on line 80

  6. 4k
    Member
    Posted 7 years ago #

    Have you been to the designers forum?

  7. ragmag
    Member
    Posted 7 years ago #

    4k, are you saying my theme is the reason why my coding won't read

    <?php if ( is_page('6') ) { ?>
    <link rel="alternate stylesheet" href="/style2.css" type="text/css" media="screen" />
    <?php } ?>

  8. DianeV
    Member
    Posted 7 years ago #

    I don't know about your theme, and I haven't tested this method of calling stylesheets.

    But, assuming that it works, where exactly did you put your style2.css? I ask because "/style2.css" means the file should be located in the root directory of your web hosting account. If you've put it in your theme directory, that (the href) part of that line should be something like:

    <?php bloginfo('stylesheet_directory'); ?>/style2.css

    because "stylesheet_directory" is for anything in your theme directory.

  9. DianeV
    Member
    Posted 7 years ago #

    Also, re:

    Parse error: parse error, unexpected $ in /home/content/r/a/g/ragmagger/html/wp-content/themes/quadruple-blue/quadruple-blue/header.php on line 80

    I'm wondering why there are two quadruple-blue folders, one within the other ... and have you checked what might be on line 80?

  10. ragmag
    Member
    Posted 7 years ago #

    Hey Diane~
    Well I think you hit the problem right on the money! *whew* I removed the double folder and now its reading the proper style sheet. Thanks so much!

  11. DianeV
    Member
    Posted 7 years ago #

    Excellent!

Topic Closed

This topic has been closed to new replies.

About this Topic