What causes the slow loading?
-
My site works (more or less) fine for almost a year, but if i open it after cleaning the cache of the browser, it takes a little bit more to load (the header and the top menu load quickly, however after that it stops for a while and then everything else loads). I was wondering what makes it stuck exactly at that point.
Here are the possible causes (header):
1. I have defined different css’ for single, page and index. It works fine, but I am not sure if its done in a “clean” way. Im afraid that maybe at this point the browser is somehow confused.
The code:
<?php if (is_single()){ ?> <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/stylesingle.css" /> <?php } else {?> <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/style.css" /> <?php } ?> <?php if (is_page()){ ?> <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/stylesingle.css" /> <?php } ?> <?php if (is_search()){ ?> <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/searchpage.css" /> <?php } ?>2. Then comes the loading of javascript which i need for the featured slider. Maybe this is the cause?
Code:
<?php $featured_slider_activate = get_theme_option('featured_activate'); if($featured_slider_activate == 'Yes') { ?> <link href="<?php bloginfo('template_directory'); ?>/css/gallery.css" rel="stylesheet" type="text/css" /> <?php } else { ?><?php { /* nothing */ } ?><?php } ?> <link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/dropmenu.jquery.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/dropmenu.js"></script> <?php $featured_slider_activate = get_theme_option('featured_activate'); if($featured_slider_activate == 'Yes') { ?> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/mootools.v1.11.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jd.gallery.v2.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jd.gallery.set.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jd.gallery.transitions.js"></script> <?php } else { ?><?php { /* nothing */ } ?><?php } ?>3. Im not an expert but is this part maybe confusing? Cause it says remove action wp head and then wp head. I dont really understand it.
<?php remove_action( 'wp_head', 'wp_generator' ); ?> <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_head(); ?>[Please use code buttons or backticks (not single quotes) for posting code]
4. Then loads the widget with a Facebook Like Box code in it. I ussualy activate the Lazy Loader plugin on such widgets so the site won’t stuck because of them. However, if i do this on the FB like box, it won’t appear in IE.
What can be the cause and the solution for this? Thanks.
The topic ‘What causes the slow loading?’ is closed to new replies.