• Resolved blakevw

    (@blakevw)


    I had a very helpful person give me a hand with using this code:

    ‘if(is_page(‘About’)){
    echo “<link href=’YOUR-STYLE-HERE’ type=’text/css’>”;
    }’

    but i dont know where to post it! please help!

    thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • This code belongs in your theme’s header.php file in between the <head> and </head> tags. You may need to wrap in in php tags like this:

    <?php
    if(is_page('About')){
    echo "<link href='YOUR-STYLE-HERE' type='text/css'>";
    }
    ?>
    Thread Starter blakevw

    (@blakevw)

    thank you!

    your welcome!

    Thread Starter blakevw

    (@blakevw)

    ok,
    so I put the code in the header.php file, where you said to put it, but it is not working…

    When I show source the page is still grabbing the main css file. any suggestions?

    the site is heelsandhammer.com and I am messing around with the about page.

    Thanks

    It looks like you put it in header.php, but I don’t think that you put it where I said to put it. Go to your About page and view the source.

    The first line reads:

    <link href='classic' type='text/css'><link href='default' type='text/css'>

    These links are wrong because they:

    1. Are outside of the <head>.
    2. Come before the DOCTYPE – which seems to force IE into quirks mode.
    3. Do not possess href attributes that reference a valid resource.
    4. Are missing the rel attribute.

    In your header.php file, look for the line that looks like this:

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    Put the conditional code after that line. This will allow your new style sheets to overwrite the styles in style.css.

    Could you explain exactly what you are trying to accomplish here? from your last post, I get the impression that you do not want the main stylesheet to be linked at all. Is this correct?

    Thread Starter blakevw

    (@blakevw)

    Thanks, I will give that a shot.

    I want to have a slightly modified theme for each author. I am just messing around with ‘about’ at the moment as a first step, and to figure out how to manipulate the text.

    I appreciate the help!

    Thread Starter blakevw

    (@blakevw)

    I have tried doing as you suggested, but There is still no change.

    Is it possible that my main theme will not allow itself to be overwritten?

    It’s working, only your still not quite doing it right, Please try this code:

    <?php
    if(is_page('About')){
    	echo '<link rel="stylesheet" href="https://www.heelsandhammer.com/wp-content/themes/green-love/style2.css" type="text/css" />';
    }
    ?>
    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Is it possible that my main theme will not allow itself to be overwritten?

    … That line of code won’t allow you to “pick a different theme” for just a single page.

    Why don’t you explain exactly what it is that you’re trying to do? You may be trying it the wrong way.

    Thread Starter blakevw

    (@blakevw)

    I would like to have a slightly different theme for certain pages. For instance, I will be co-blogging with my GF and we would like her page to be slightly different, including colour and top banner. but the rest of the style would remain the same.

    Thread Starter blakevw

    (@blakevw)

    IT WORKS!!!

    Thank you sooooo much! I have been trying to do this for days now!

    I really appreciate your help

    You cannot really have “different theme” inside one blog. You can have, eventually, different design for certain template files: a Page template, a category template etc.
    And I don’t think just changing/switching the stylesheet alone you can achieve what you want. A few themes do similar things, like having several ‘colour variations’ – you should study them and see how it is done. Most of the time they have a basic stylesheet AND another one defining the colour scheme etc.

    No problem, Glad it worked out!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘if(is_page(‘About’): where does this text go?’ is closed to new replies.