Author archive pages loading slow
-
Besides the fact that these pages load slow no matter how many posts an author has written, these pages also get a http error, when i do a check (via https://httpstatus.io/).
Bear in mind that I am not a proper developer, and this project was once outsourced, so I am just trying to get this fixed.
I have read something about query_posts being deprecated, so this is where my focus went, but I wasn’t able to do anything.
Here’s the code, I appreciate the time.<?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'); ?> <?php 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)); ?> <?php $wp_query->query_vars['page'] > 1 ? $current = $wp_query->query_vars['page'] : $current = 1; query_posts( array( 'post_type' => array('magazines'), 'author' => $author, 'posts_per_page' => 5, 'paged' => $current ) ); if (have_posts()) : ?> <h1><?php _e('Author : ','vergo');?><?php echo $curauth->display_name; ?></h1> <div style="clear: both;"></div> <div class="postauthor"> <!-- <h3><?php /*_e('About Author: ','vergo'); */?></h3> --> <?php echo get_avatar($curauth->user_email, 90 ); ?> <p class="authordesc"> <?php _e('Website','vergo');?>: <a>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(); ?> <?php get_template_part('/includes/post-types/archivepost');?> <?php endwhile; ?> <!-- end post --> </ul><!-- end latest posts section--> <div style="clear: both;"></div> <div class="pagination"><?php pagination('«', '»'); ?></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 --> <!-- TEST ADDITION!!!!! --> <!-- END OF TEST!!!! --> <div id="rightsidebar" class="body2 snap-right-part-new"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Right Sidebar") ) : ?> <?php endif; ?> </div> <?php get_footer(); ?>'
- This topic was modified 5 years, 1 month ago by . Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Author archive pages loading slow’ is closed to new replies.