• So I’m shortcoding into a page builder widget like

    Getting the shortcode from Woody Snippets with the code

    <?php
    error_reporting(0);
    echo ‘<div class=”small-12 medium-10 columns”>’;
    echo ‘<div class=”blogArticles” data-equalizer>’;

    $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1;
    //$args = array( ‘post_type’ => ‘post’,’paged’ => $paged, ‘posts_per_page’ => ‘6’ );
    $args = array( ‘post_type’ => ‘post’,’paged’ => $paged, ‘post__in’ => array_reverse($id) );

    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post();

    echo ‘<div class=”nainv” data-equalizer-watch><div class=”small-12 medium-4 columns”><div class=”homePostThumb”>’;
    the_post_thumbnail(‘thumbnail’);
    echo ‘</div></div><div class=”nainvtext”><a href=”‘;
    the_permalink();
    echo ‘”><h2 class=”blogTitle”>’;
    the_title();
    echo ‘</h2><div class=”blogDate”>’;
    the_time(‘l jS F Y’);
    echo ‘</div>’;
    the_excerpt();
    echo ‘</div></div>’;

    endwhile;

    echo ‘</div></div>’;
    echo ‘<div class=”blogPagination”>’;

    $nav = get_the_posts_pagination( array (
    ‘mid_size’ => 2,
    ‘prev_text’ => __( ‘<i class=”fa fa-chevron-left” aria-hidden=”true”></i>Previous’, ‘textdomain’ ),
    ‘next_text’ => __( ‘<i class=”fa fa-chevron-right” aria-hidden=”true”></i>Next’, ‘textdomain’ ),
    ‘screen_reader_text’ => __( ‘A’ )
    ) );

    //$nav = str_replace(‘<h2 class=”screen-reader-text”>A</h2>’, ”, $nav);
    echo $nav;
    echo ‘</div>’;
    ?>

    So I get 6 posts out but no pagination linkage to the next set of 6 and I have no idea why not, if some kind person can spot where/what I am doing wrong I’ll keep my hair! Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter MikeKJ

    (@mikekj)

    amendment

    $args = array( ‘post_type’ => ‘post’,’paged’ => $paged, ‘posts_per_page’ => ‘6’ );
    //$args = array( ‘post_type’ => ‘post’,’paged’ => $paged, ‘post__in’ => array_reverse($id) );

Viewing 1 replies (of 1 total)
  • The topic ‘problem with pagination’ is closed to new replies.