How to fix a specific page (author archive) loading speed?

For some reason, author pages on my blog are loading extremely slow, even for authors that have very few posts, as you c

For some reason, author pages on my blog are loading extremely slow, even for authors that have very few posts, as you can see [here][1]. I am not a developer, but I can understand the code a little bit. Please assist, thank you.

        <?php 
        // Register Calendar widget scripts
       function snaplap_widget_calendar_scripts_and_styles(){
        wp_register_style( 'LatoWidget', get_stylesheet_directory_uri() . '/js_calendar/css/Lato_300_400_700.css');
        wp_enqueue_style( 'Lato' );
        wp_register_style( 'FontAwasomeCalendarWidget', get_stylesheet_directory_uri() . '/js_calendar/css/fontawesome.css');
        wp_enqueue_style( 'FontAwasomeCalendarWidget' );
        wp_register_style( 'stylePersonalCalendarWidget', get_stylesheet_directory_uri() . '/js_calendar/css/style-personal.css');
        wp_enqueue_style( 'stylePersonalCalendarWidget' );

        // Register and Enqueue a Script
        // get_stylesheet_directory_uri will look up child theme location
        wp_register_script( 'jQueryLatestCalendarWidget', get_stylesheet_directory_uri() . '/js_calendar/js/jquery-latest.min.js');
        wp_enqueue_script( 'jQueryLatestCalendarWidget' );
        wp_register_script( 'simpleCalendarWidget', get_stylesheet_directory_uri() . '/js_calendar/js/simplecalendar.js');
        wp_enqueue_script( 'simpleCalendarWidget' );
    }

    add_action('wp_enqueue_scripts', 'snaplap_widget_calendar_scripts_and_styles'); 

 get_header(); ?>

    <div id="core" class="snap-left-working-area search-result">

        <div id="content">

                    <?php
                    $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));

                    $wp_query->query_vars['page'] > 1 ? $current = $wp_query->query_vars['page'] : $current = 1;
                    query_posts( array(
                        'post_type' => array('post','magazines'),
                        'author' => $author,                    
                        'posts_per_page' => 5,
                        'paged' => $current ) 
                    );

                    if (have_posts()) : ?>

                    <h1><?php _e('Author : ','vergo'); echo $curauth->display_name; ?></h1>

                <div style="clear: both;"></div>

                <div class="postauthor">

                    <?php echo get_avatar($curauth->user_email, 90 ); ?>

                    <p class="authordesc">
                        <?php _e('Website','vergo');?>: <a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a><br/>
                        <?php echo $curauth->user_description; ?>
                    </p>

                </div>

                <div style="clear: both;"></div>

                <ul class="archivepost">

                    <?php while (have_posts()) : the_post();
 get_template_part('/includes/post-types/archivepost'); 
 endwhile; ?>   <!-- end post -->

                </ul><!-- end latest posts section-->

                <div style="clear: both;"></div>

                        <div class="pagination"><?php pagination('&laquo;', '&raquo;'); ?></div>

                        <?php else : ?>         

                            <h3>This author has not created any posts.</h3>

                            <?php get_search_form(); ?><br/>
                        <?php endif; ?>

        </div><!-- end #core .eightcol-->

        <!-- #sidebar -->          

        <!--<div id="core_bg"></div>-->

    </div><!-- #core -->

    <div id="rightsidebar" class="body2 snap-right-part-new">
        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Right Sidebar") ) : 
endif; ?>
    </div>

    <?php get_footer(); ?>

  [1]: /

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744838473a4596407.html

相关推荐

  • How to fix a specific page (author archive) loading speed?

    For some reason, author pages on my blog are loading extremely slow, even for authors that have very few posts, as you c

    2天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信