Functions.php
Hallo Leute,
in Google Chrome lädt das Stylesheet meiner Seite von mir sehr langsam, dabei habe ich sie standardgemäß im Header platziert. Komischerweise wird das Stylesheet auch in der functions.php abgefragt, das habe ich aus dem "Starkers"-Theme übernommen:
Meine functions.php
PHP
<?php
/* ========================================================================================================================
Theme specific settings
Uncomment register_nav_menus to enable a single menu with the title of "Primary Navigation" in your theme
======================================================================================================================== */
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 800, 800 );
}
// register_nav_menus(array('primary' => 'Primary Navigation'));
/* ========================================================================================================================
Actions and Filters
======================================================================================================================== */
add_action( 'wp_enqueue_scripts', 'starkers_script_enqueuer' );
add_filter( 'body_class', array( 'Starkers_Utilities', 'add_slug_to_body_class' ) );
/* ========================================================================================================================
Custom Post Types - include custom post types and taxonimies here e.g.
e.g. require_once( 'custom-post-types/your-custom-post-type.php' );
======================================================================================================================== */
/* ========================================================================================================================
Scripts
======================================================================================================================== */
/**
* Add scripts via wp_head()
*
* @return void
* @author Keir Whitaker
*/
function starkers_script_enqueuer() {
wp_register_style( 'screen', get_stylesheet_directory_uri().'/style.css', '', '', 'screen' );
wp_enqueue_style( 'screen' );
}
Alles anzeigen
<head> meiner Header.php
PHP
<!DOCTYPE HTML>
<!--[if IEMobile 7 ]><html class="no-js iem7" manifest="default.appcache?v=1"><![endif]-->
<!--[if lt IE 7 ]><html class="no-js ie6" lang="en"><![endif]-->
<!--[if IE 7 ]><html class="no-js ie7" lang="en"><![endif]-->
<!--[if IE 8 ]><html class="no-js ie8" lang="en"><![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<title><?php bloginfo( 'name' ); ?><?php wp_title( '|' ); ?></title>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no""><!-- Remove if you're not building a responsive site. (But then why would you do such a thing?) -->
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/img/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="format-detection" content="telephone=no">
<meta name="keywords" content="Injuvik">
<meta name="description" content="Analogue Loop Music.">
<?php wp_head(); ?>
</head>
Alles anzeigen
Ist das nicht überflüssig? Und hat das vielleicht etwas damit zu tun?
Für Ratschläge bin ich sehr dankbar!
Beste Grüße,
Tim