WordPress.org

Ready to get started?Download WordPress

Forums

Using several css within the same page (4 posts)

  1. JoannesVermorel
    Member
    Posted 9 years ago #

    I am currently designing a template (see http://wordpress.org/support/topic/35746) that would require the use of two CSS within the same page.

    I mean using two CSS simultaneously. For now, I am using a dirty hack which consists of appending the second CSS to the kubrick CSS .

    What is the correct (clean) way of achieving this effect?

  2. Lorelle
    Member
    Posted 9 years ago #

    Do you want to use the two CSS for EVERY page on your site or just for a couple of pages?

    Here is what I used to put in an additional style sheet (there is no crime in having more than one) for posts within a specific category.

    Creating Multiple Single Posts for Different Categories

  3. JoannesVermorel
    Member
    Posted 9 years ago #

    Actually there is not conflict in two considered CSS (the one of WP and the other one). Therefore, the easy path is simply to display both CSS on every page.

    I see three solutions:
    - modify style.css (just append the second stylesheet).
    - modify header.php (add second CSS ref)
    - create header2.php (and link this file from the template, as you suggest in your page)

    Those solutions are not really satisfying because they do not really match the Plugins hooks. But maybe I am asking to much :-).

  4. JoannesVermorel
    Member
    Posted 9 years ago #

    Ok, I finally found out what was the way to go to handle a second CSS. I just added a small action hook on wp_head to add the additionnal stylesheet reference.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.