• FGazerro

    (@fgazerro)


    Hello,

    I have a theme installed that uses multiple stylesheets. The first is the normal style.css. The others are located in another folder and they are for specific elements (nav.css, home.css, print.css).

    I want to consolidate them into the normal style.css but I can’t seem to make it work. Any help would be greatly appreciate. Below I’ll paste everything in header.php up to the links to the stylesheet. Thanks.
    Frank

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
    <html xmlns=”http://www.w3.org/1999/xhtml&#8221; <?php language_attributes(); ?>>
    <head profile=”http://gmpg.org/xfn/11″&gt;
    <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />

    <title><?php if ( is_single() ) {
    wp_title(”);
    echo (‘ | ‘);
    bloginfo(‘name’);

    } else if ( is_page() || is_paged() ) {
    bloginfo(‘name’);
    wp_title(‘|’);

    } else if ( is_author() ) {
    bloginfo(‘name’);
    wp_title(‘ | Archive for ‘);

    } else if ( is_archive() ) {
    bloginfo(‘name’);
    echo (‘ | Archive for ‘);
    wp_title(”);

    } else if ( is_search() ) {
    bloginfo(‘name’);
    echo (‘ | Search Results’);

    } else if ( is_404() ) {
    bloginfo(‘name’);
    echo (‘ | 404 Error (Page Not Found)’);

    } else if ( is_home() ) {
    bloginfo(‘name’);
    echo (‘ | ‘);
    bloginfo(‘description’);

    } else {
    bloginfo(‘name’);
    echo (‘ | ‘);
    echo (”.$blog_longd.”);
    }
    ?></title>

    <meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” />
    <?php wp_head(); ?>
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_url’); ?>/style.css” type=”text/css” media=”screen” />
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_url’); ?>/css/nav.css” type=”text/css” media=”screen” />
    <?php if (is_home() ) { ?>
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_url’); ?>/css/home.css” type=”text/css” media=”screen” />
    <?php } ?>
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_url’); ?>/css/print.css” type=”text/css” media=”print” />

Viewing 1 replies (of 1 total)
  • Frank,

    “If it ain’t broke then don’t try to fix it.”

    By the looks of things, the only two stylesheets that you should attempt to consolidate are style.css and nav.css.

    If you created a blank document and added all of the styles in order, you would definitely NOT get the desired result. The last stylesheet listed is a special stylesheet (print.css) this file is called when a user prints a page from your site. Stylesheets of this nature will generally set all colors to black and white and not display any images. For best results, leave this as it is.

    home.css most likely contains styles that are only to be applied to you site’s homepage. I have no idea why the developer has separated the styles into their own sheet, but he/she probably had a good reason. It’s probably best to leave this alone too.

    Both style.css and nav.css appear to be called on every page-view hypothetically allowing you to copy the code from nav.css into style.css. If you do decide to do this make sure to leave the header information in your style.css intact (failure to do this will “kill the theme”) and to delete the <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/nav.css" type="text/css" media="screen" /> in your header.php

    and remember: “If it ain’t broke then don’t try to fix it.”

Viewing 1 replies (of 1 total)

The topic ‘Help With Consolidating Multiple Style Sheets’ is closed to new replies.