• Hello everyone!!
    Today i have a an epic ethic question.

    The_question_itself: ?I’m doing it wrong using 2 Stylesheet files in my theme?

    The_explanation:
    Imagine, i’m working on a theme where the posts in “index.php” are like:
    – a 200x600px Post Wrapper
    – a 200x50px Title & excerpt thinghie (float left;)
    – a 200x530px Image Thumbnail (mady by customflieds and float: right;)

    Well. once i click on a post to read the full content i would like to remove the thumbnail and make the tittle and the content thinghie to be 600px width.

    Here comes the solutions i found:
    A- Create new Class Divs for the new displaying of the post and add its new style on Style.css

    B- make “Single.php” to target a new Stylesheet file called “single-style.css” and then just modify the values i need for the new content display.

    Thoughts:
    I dont know wich option is the correct one.

    Option A seems to be the basic and tipical option.
    But B, seems to be more logical and ethic for me, as i wont need to put code that is not going to be used in index.php and viceversa in single.php.
    Each *.php file will have it’s own css code.

    I tested it a bit and if i create an empty single-style.css and visit the single.php page it seems to still reading the style values i used in the basic “style.css” file. So if i modify specific parts of the “style.css” file in the new “single-style.css” file. Everything seems to works fine. Whatever i dont modify, stills being displayed as normal. Whatever i modify, changes…

    Is that correct? it’s ethic?
    Any idea?

    Thanks in advance!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • I don’t think there’s anything wrong with using 2 stylesheets.

    Thread Starter alaguapatos

    (@alaguapatos)

    Hi Esmi! Long time no see!

    Thank you for the reply. Now i’ll use two stylesheets without regreting.

    ehhrmm.. Another little question:
    Wich way is the correct one to call a new stylesheet?

    the one i’m using is puting this:
    ‘<link rel=”stylesheet” href=”/wp-content/themes/The Box 2.0/style_single.css” type=”text/css” media=”screen” />’
    at the top of the “single.php”

    It seems to run ok, but as i said, if i left empty that “single-style.css” it seems to still using the latest css atributes i used before in the index.php with his style.css.

    Is there any way to call the new stylesheet and even do a global reset of styles before loading the new page?
    is this question silly enough? ??

    Again. Thanks in advance!
    My new portofolio is at 70% atm ^^

    PD: my apologies for the huge content of my posts. Keep in mind that i’m Spanish, and i’m doing my best to write in a way that i can understand and others can, too… (or i hope they do)

    hugs!

    Personally, I’d use:

    <?php if( is_single() ) :?>
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style_single.css" type="text/css" media="screen" />
    <?php endif;?>

    in header.php to call the additional stylesheet. Just make sure that this is after the call to style.css or another other screen-based stylehseets in the header code.

    If you need to perform a global reset, you could either add your resets to the top of style_single.css or call a separate reset sheet as part of the conditional:

    <?php if( is_single() ) :?>
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/reset.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style_single.css" type="text/css" media="screen" />
    <?php endif;?>

    And – no – the question is nowhere near silly enough. ??

    If it helps at all, I’ve created themes that contain 4 or 5 stylesheets – all called at different times etc.

    And your English is way better than my Spanish (which is almost non-existent).

    Thread Starter alaguapatos

    (@alaguapatos)

    Yay! thanks a lot. This is exactly what i was looking for!
    Can’t wait until 6p.m. to start coding again.

    Pd: As Spanish guy, in the world we live you have no option to survive if you dont (at least) understand english.
    There’s a huge bunch of information aviable and most of the times this information comes in english.
    At the present time, skipping information just because you don’t understand it, it’s a huge fail.
    Do you guys remember how to do when you wanted to learn something before “The Internet”?
    Isn’t fantastic that today we are in a some kind of “global mind sharing” where the limits of every single person are their own imagination?

    anyway, thanks a lot for the reply!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘i’m doing it wrong using 2 Stylesheet files?’ is closed to new replies.