Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jjf21

    (@jjf21)

    I’ve attached my new repeater template, but it is still not working.

    https://www.dropbox.com/s/95pcuhivp3sfvuw/default.php?dl=0

    
    <?php
    /*
     * Template Name:
     */
    
    $the_query = new WP_Query( [
        'posts_per_page' => 14,
        'paged' => get_query_var('paged', 1)
    ] );
    
    if ( $the_query->have_posts() ) { ?>
        <div id="ajax-load">
        <?php
        $i = 0;
        while ( $the_query->have_posts() ) { $the_query->the_post();
    
            if ( $alm_item % 7 === 0 ) {  // Large posts ?>
            <article <?php post_class( 'col-sm-12 col-md-12' ); ?>>
                <div class="large-front-container">
    <?php the_post_thumbnail('full', array('class' => 'large-front-thumbnail')); ?>
                    </div>
                <h2><a class="post-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                <p class="front-page-post-excerpt"><?php echo get_the_excerpt(); ?></p>
                <a class="moretext" href="<?php the_permalink(); ?>">Read more</a>
                    <?php get_template_part ('front-page-shop'); ?>
                                     <?php get_template_part( 'share-buttons' ); ?>
                    <div class="front-comments"><?php comments_popup_link ('0', '1', '%', 'comment-count', 'none'); ?></div>
                </article><?php
    
            } else {  // Small posts ?>
                <article <?php post_class( 'col-sm-6 col-md-4' ); ?>>
                    <div class="front-thumbnail-image"><?php the_post_thumbnail('full', array('class' => 'medium-front-thumbnail')); ?></div>
                    <a class="front-page-post-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                    <p class="front-page-post-excerpt"><?php echo get_the_excerpt(); ?></p>
                    <a class="moretext" href="<?php the_permalink(); ?>">Read more</a>
                    <?php get_template_part ('front-page-shop'); ?>
                                     <?php get_template_part( 'share-buttons' ); ?>
                    <div class="front-comments"><?php comments_popup_link ('0', '1', '%', 'comment-count', 'none'); ?></div>
                </article>
                <?php
            }
            $i++;
        }?>
        </div>
        <?php if(get_query_var('paged') < $the_query->max_num_pages) {
        }
    }
    elseif (!get_query_var('paged') || get_query_var('paged') == '1') {
        echo '<p>Sorry, no posts matched your criteria.</p>';
    }
    wp_reset_postdata();
    
    Thread Starter jjf21

    (@jjf21)

    Here is a link to my front-page.php file. As you can see I have 14 posts per page. 1 in a row, 3 in a row, 3 in a row. I just want to add the load more button after every 14 posts. However, I don’t know how I could achieve this. I would appreciate any help!

    https://www.dropbox.com/s/ax15kaa8msvunoe/front-page.php?dl=0

Viewing 2 replies - 1 through 2 (of 2 total)