Loading posts grid too slow in custom front page
-
Hi,
I created a child theme of Oblique and set a custom front page by a written a front-page.php.
In my front page, I insert such code to display a recent post list like this:<div id="news-grid" class="grid-layout"> <?php $catName = 'news'; $query = new WP_Query( array( 'post_type' => 'post', 'category_name' => $catName, 'posts_per_page' => 8 ) ); while ( $query->have_posts() ) : $query->the_post(); get_template_part( 'content', get_post_format() ); endwhile; ?> </div>
The list loads very slow and I found that if I remove the “class=”grid-layout”” in div, the posts will show in normal speed but lost all styles.
Any one can help me? Thanks a lot!
My site: http://catheaven.studio/
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Loading posts grid too slow in custom front page’ is closed to new replies.