0

I want to create a simple one page storytelling wordpress website. I've created a category to hold all the posts that will be the main content for the stories and I want to display them on the homepage. I have for now the standard loop, but I want to load the contents using the REST API to avoid page reloads. My question is how I can add two arrows on the left and on the right to select a previous post of the category or the next one?

<php

if( have_posts() ): while( have_posts() ): the_post();
the_title('<h1>','</h1>');
the_content();
endwhile;
endif;
// here I want to add the needed code and markup for the next and previous arrows.
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.