• Resolved Max

    (@panmac)


    Hi – I am a total noob and this is my first time migrating a static site onto wordpress.

    One of the main troubles I’m having regards loading stylesheets only on specific pages or while using specific templates.

    I have a page that continues to load a stylesheet that I don’t want to use on it. I’m not an expert at CSS or PHP, so I can’t see why it’s loading even though I’ve specified a different stylesheet in header.php.

    Here’s the way the page SHOULD look:
    http://www.phoenixrisingtheater.org/contact.html

    and here’s what’s happening in wordpress:
    http://www.phoenixrisingtheater/dynamic/contact-2

    I don’t want “singlecol.css” to load on this page, I want “twocol.css” and the main style.css only.

    And I’m sorry it’s such a mess, but here’s my code from header.php:

    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/default.css" type="text/css">
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css">
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/footer.css" type="text/css">
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/nivo-slider.css" type="text/css">  
    
    <?php if (is_single) { ?>
         <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/singlecol.css" type="text/css" media="screen" />
    <?php } else { ?>
         <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <?php } ?>
    
    <?php if (is_page('about') ) { ?>
         <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/about.css" type="text/css" media="screen" />
    	<?php } ?>
    
    <?php if (is_page_template('twocol.php') ) { ?>
         <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/twocol.css" type="text/css" media="screen" />
    <?php }	else { ?>
    	     <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    
    	<?php } ?>
    
    <?php if (is_page('current-season') ) { ?>
         <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/singlecol.css" type="text/css" media="screen" />
    <?php } else { ?>
         <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <?php } ?>

    Any tips for cleaning this up would be appreciated as well. 🙂

    Thank you in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need to stop a stylesheet from loading’ is closed to new replies.