• Is it possible to make a unique styling for specific pages? Because I find that putting all the styling in one file makes reading it again a difficult thing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • WoW… I can imagine a solution, but that would be terrible to work with it… That would only make sense, if you have a different style on every page…

    Can you give us a little bit more details, maybe with an example…

    Thread Starter wiegs015

    (@wiegs015)

    For example, if I develop a theme, then there will be some template files. Some of it may have a little bit styling, for example the menus have a different background.

    Or maybe, some elements of the page are different.

    I’m aware that we can put all of the styling in style.css but as I said, it becomes pretty inconvenient to work with.. So, I was wondering are there any better ways?

    You can try such a solution…. e.g.

    <?php
                //portfolio page css
                if (is_page('portfolio-page-slug')) { ?>
                    <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/my-special-css-files/portfolio.css" type="text/css" />
    
                <?php }
                //coloring the menu in a special way
                else if (is_page(array( 'about-me-slug', 'contact-slug', 'some-other-page-slug' ) )) { ?>
                    <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/my-special-css-files/special-menu.css" type="text/css" />
    
                <?php } ?>

    And have a look at: http://codex.wordpress.org/Conditional_Tags

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page specific CSS’ is closed to new replies.