Website doesn't show next/previous page button php code

The code looks like this code

        <div class="clearfix"></div>
        <div class="nav-previous alignleft"><?php next_posts_link( 'Older posts' ); ?></div>
        <div class="nav-next alignright"><?php previous_posts_link( 'Newer posts' ); ?></div>
        <?php endif; ?>
	<!-- /NEWS --> ```code```

It is a pre built website theme for WordPress, the syntax is wrong as i can see. The website used to show the buttons, and suddenly they disappeared. I don’t know how to code so if anyone could help me, I would be more than happy

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

<?php endif; ?>

This line indicates that the lines above it are only shown if the current conditions match the if statement that starts this block. Your buttons are likely not showing up because the if statement that starts this block is returning false.