- This topic is empty.
-
AuthorPosts
-
February 10, 2010 at 8:13 pm #27955
markito
MemberHi
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?
ThnaxFebruary 10, 2010 at 9:52 pm #70739TheDoc
Member1. 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:markito
MemberWell is not working :-( … any ides on this one?
February 11, 2010 at 12:38 pm #70731TheDoc
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?
February 11, 2010 at 12:44 pm #70732TheDoc
MemberSilly me, I see the problem here!
Give this one a go:
Code:‘;
}
else {
echo ‘‘;
}
endif ?>February 11, 2010 at 3:15 pm #70770euanmead
MemberCode:
February 11, 2010 at 5:14 pm #70781TheDoc
MemberI 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:February 11, 2010 at 5:31 pm #70782davesgonebananas
MemberSince you want it to act on the homepage you should replace is_page_template("page-snippet.php") with is_front_page().
February 11, 2010 at 5:36 pm #70784TheDoc
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.
AuthorPostsViewing 9 posts - 1 through 9 (of 9 total)- The forum ‘Back End’ is closed to new topics and replies.