February 10, 201313 yr Hi folks, How do I get a page of a wordpress website to use a different stylesheet to its theme stylesheet?. If I just add the hard link to the stylesheet in the header of the page will it override the themes stylesheet?.
February 10, 201313 yr You could create a new template, copying the old one and just edit the css it grabs to the new one you want?
February 10, 201313 yr Hope this would help: http://codex.wordpress.org/Function_Reference/wp_enqueue_style
February 10, 201313 yr Author You could create a new template, copying the old one and just edit the css it grabs to the new one you want? This sounds like a good idea, but not sure how I would have 2 active themes on one wordpress installation? Hope this would help: http://codex.wordpress.org/Function_Reference/wp_enqueue_style The current header.php file for my theme uses <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> to link to the stylesheet so I'm not sure where/how I would add the wp_enqueue function?
February 11, 201313 yr CSS is rendered 'top-down', so if you queue your new style sheet below the theme's stylesheet it will override any rules in the previous stylesheets. As teodora says, hooking into the WordPress wp_enqueue_scripts action is the neatest way of adding a stylesheet. Alternatively, you could edit your WordPress themes header.php file and insert your new style under it's own style. Another option is to add a conditional if / else statement to load an entirely different style sheet based on the page id or slug. http://codex.wordpress.org/Function_Reference/is_page Hope this helps! Rich
Create an account or sign in to comment