Why are all my stylesheets being called on WordPress template?
-
I’m designing a custom WP template. However, while editing in Google Dev Tools, it looked like each of my individual WP pages were calling every single stylesheet I am using. What am I doing wrong? Or am I assuming incorrectly? Here’s some code:
Header:
<!DOCTYPE html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title><?php echo get_bloginfo( 'name' );?></title> <meta name="description" content="<?php get_bloginfo('description');?>"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/CSS/universal.css" media="screen" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <!----------- HEADER NAVIGATION --------------------------------> <div id="navBackground" class="navbar-fixed-top"> <nav class="col-xs-10 col-xs-offset-1 m-y-1"> <a href="/index.php"> <img src="<?php bloginfo('template_directory');?>/img/fullLogo.png" class="fluid-img pull-md-left" id="navLogo"> </a> </div> <?php wp_head() ?> </head>
Example Custom Page:
<?php /* Template Name: Approach Template */ ?> <?php get_header() ?> <link rel="stylesheet" href="<?php bloginfo('template_directory');?>/CSS/approach.css"> <!--------------- Approach Intro --------------------> <div id="introParagraph" class=" col-xs-12 p-y-2 m-b-3"> <?php if (have_rows('approach_introduction')):while(have_rows('approach_introduction')):the_row(); ?> <h1 class="text-xs-left col-xs-10 col-md-offset-1 m-b-1"> <?php the_sub_field('page_header'); ?> </h1> <div class="col-md-3 col-md-offset-1 col-xs-7 m-t-1"> <h3 class="text-xs-left" id="headerDescription"> <?php the_sub_field('page_description_paragraph'); ?> <br><br> Click on the icons to learn more. </h3> </div> <?php endwhile; else : // no rows found endif; ?> </div>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Why are all my stylesheets being called on WordPress template?’ is closed to new replies.