• Hi Guys!

    I’m just trying to find the best way to add additional CSS files based on where I’m at in a site.

    Say for example that I want to make some small CSS tweaks to the registration page, but I don’t want it to carry over to the rest of the site. I’d like to be able to tell my blog that “hey! This one page, and possibly that other one over there need to also load this file here!”.

    I’ve tried using a conditional statement based off of $_SERVER[“REQUEST_URI”] but it doesn’t seem to work right.

    Any ideas?

    Thanks!
    –Lisa

Viewing 4 replies - 1 through 4 (of 4 total)
  • You know, it probably takes more resources to process a set of conditionals and load additional CSS sheets on a per-page basis than it does to load 1 or more large sheets that are used right across the site. Once the standard sheet(s) been downloaded on the first page, they’ll be pulled from the local cache on every subsequent page.

    Why not place all of your CSS in 1 or 2 files and use specific classes or ids to apply your styling?

    Thread Starter Lriggle

    (@lriggle)

    Can’t you just humor me instead of trying to lecture me?

    The goal in this instance isn’t to be the most efficient and make things load faster, it’s to learn something new and try and get a better understanding of how WordPress handles things of that sort. That way when clients ask me about doing something similar I can give them advice based on my own experiences, instead of just repeating what someone told me.

    In that case, why not use is_page('About') or is_single('20')?

    http://codex.wordpress.org/Conditional_Tags

    Thread Starter Lriggle

    (@lriggle)

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Additional CSS files based on part of site’ is closed to new replies.