admin管理员组

文章数量:1244439

Trying to avoid pagination on the blogs page, I'm getting a layout based on fallback to basic post display. This is like infinite scroll but I get only 10 posts in next page with the load more p

My entire block theme folder is 11kb. It has just one index.html in the /templates and header, footer in the /parts.

How can I improve the page layout for posts appearing after load more button is clicked.

if ($query->have_posts()) {
            while ($query->have_posts()) {
                $query->the_post();
                // First try theme's content template
                $template = locate_template('template-parts/content.php');
                if ($template) {
                    get_template_part('template-parts/content');
                } else {
                    // Fallback to basic post display
                    ?>
                    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                        <header class="entry-header">
                            <?php the_title('<h2 class="entry-title"><a href="' . esc_url(get_permalink()) . '">', '</a></h2>'); ?>
                        </header>
                        <div class="entry-content">
                            <?php the_excerpt(); ?>
                        </div>
                    </article>
                    <?php
                }
            }

本文标签: infinite scrolllayout issue after load more for posts