-1
 <?php

    if ( have_posts() ) 
    while ( have_posts() ) : the_post(); 

?>
<?php
            endwhile;
                    the_posts_pagination( array(
                        'prev_text'          => "<i class='fa fa-angle-left'></i>".esc_html__(' Prev'),
                        'next_text'          => esc_html__('Next ' )."<i class='fa fa-angle-right'></i>",
                        'before_page_number' => '',
                    ) ):
            // If no content, include the "No posts found" template.
            else ;
                get_template_part( 'content', 'none' );
            endif;
        ?>
lagbox
  • 48,571
  • 8
  • 72
  • 83
josh
  • 1
  • 1
  • Welcome to SO ... you would need to look before the `endwhile;` for the issue – lagbox Nov 08 '20 at 06:06
  • 1
    How did this code materialize? Why did all the other questions make you think endwhile pairs with else and endif? – mario Nov 08 '20 at 06:13
  • 1
    The `if` line has no `{` or `:` to start a block, so the `while` is "inside" the `if` block but your `endwhile` is outside of it. – Niet the Dark Absol Nov 08 '20 at 06:34

1 Answers1

2

where are "while():" in your code ? you need to check your code is structured correctly like this:

<?php
while():
// something here
endwhile;
hknight
  • 41
  • 1
  • 3