Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Multiple stylesheets in Wordpress

Featured Replies

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?.

  • 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?

 

 

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?

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.