Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress – Linking two different style sheet

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #27955
    markito
    Member

    Hi
    Does anybody can tell me how do I link in WordPress to two different pages to different style sheet.I would like to have different layout in home page but rest of the pages would remain and have defaults styles.css.Where do I place link that link up external sheet for it? WordPress is using same styles everywhere .Any help or suggestions here please?
    Thnax

    #70739
    TheDoc
    Member

    1. Find the id number of the page you want the special stylesheet to go to.

    2. Open up header.php and find where your stylesheet is being linked from.

    Change:

    Code:
    Code:
    /your-special-file.css” media=”screen” />’;
    }
    else {
    echo ‘
    #70759
    markito
    Member

    Well is not working :-( … any ides on this one?

    #70731
    TheDoc
    Member
    "markito" wrote:
    Well is not working :-( … any ides on this one?

    Just to make sure my PHP is wrong and nothing else, did you replace "id#" with your home page’s id?

    #70732
    TheDoc
    Member

    Silly me, I see the problem here!

    Give this one a go:

    Code:
    ‘;
    }
    else {
    echo ‘‘;
    }
    endif ?>
    #70770
    euanmead
    Member
    Code:





    #70781
    TheDoc
    Member

    I don’t think you understand what the OP is asking for.

    Here’s another one, from Chris’ book Digging into WordPress.

    Conditionally loading extra CSS files

    Code:
    #70782

    Since you want it to act on the homepage you should replace is_page_template("page-snippet.php") with is_front_page().

    #70784
    TheDoc
    Member
    "davesgonebananas" wrote:
    Since you want it to act on the homepage you should replace is_page_template("page-snippet.php") with is_front_page().

    Yes, sorry, forgot to update that. Too quick with my copy and paste!

    Should also mention that when using that method, it means you’ll have two stylesheets being loaded at the same time.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Back End’ is closed to new topics and replies.