0

I am getting a weird loading issue on my Wordpress theme that happens on Chrome only, I've tested it on Safari and Firefox, the content gets loaded all in once, but if you scroll down the page fast on the Chrome browser, it shows blank areas and loads the remaining content after 1 second, please check it out at http://xscoder.com/wp-demo/vintymag/

Any idea of what's causing that sort of "flickering" issue?

I've also noticed that the sidebar follows the content while scrolling down, which is something I haven't coded in my functions.php file, so I have no idea why it does that...

My index.php file is empty because I've created a page.php file that calls header and footer and hosts all the content of the Home page. And in my page.php file I call a few different queries, like this:

<?php get_header() 
/* 
    Template Name: Home - Default
*/
?>
<?php
   $query_latest_carousel = new WP_Query( array(
      'posts_per_page' => 4,
   )); 
   // the Loop...

then:

    <?php  $query_featured_posts = new WP_Query( array( 'tag' => 'featured' ) );
   // the Loop...

And another one:

 // search for 'featured' tag 
   $tags = wp_get_post_tags($post->ID);
    foreach ( $tags as $tag ) {
      if ($tag->name == 'featured') {
         $tag_id = $tag->term_id;
      }
    }

    // query without 'filtered' tag
   $query_posts = new WP_Query( 
      array(
         'tag__not_in' => array($tag_id),
         'posts_per_page'=>-1,
      )
   );
   // the Loop...


<!-- Sidebar--> 
<aside class="col-md-4 sidebar_right">
<?php dynamic_sidebar('right-sidebar'); ?>
</aside><!-- ./ Sidebar-->

<?php get_footer(); ?>

May this be the issue, too many different queries in the same page? And if that's yes, why does my website work perfectly on Firefox?

Any help will be greatly appreciated, thanks!

  • 1
    Maybe Chrome is just freaking out because of the page size. According to a Pingdom test I ran, the page was about 60MB. – Antti Koskinen Apr 29 at 16:17
1

Your queries are not the issue, those should be handled without a problem.

I can't say for sure without really digging into this but I would start with optimizing your page. Your thumbnails are like 4-6 MB each. I could optimize these images down to 20K without losing quality.

enter image description here

The initial page load takes 22 seconds and that is in Chrome and Firefox.

The flickering issue I think has to due with the fixed sidebar. There is an onscroll event being fired every time you scroll the page that chrome has a hard time handling but that very well could be due to the massive page size.

  • thanks for your answer, @riddlemethis, I’ll reduce the images size and see what happens – xscoder Apr 29 at 18:07
  • I've just marked your answer as accepted, you were right @RiddleMeThis, thanks again, I was ignoring the image size issue :) – xscoder Apr 30 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.