I have made little shortcodes to insert data to my home screen. I loop over total number of posts and output pre-styled html.
My question is, is it possible to also make pagination for that kind of loops? For example if I have 10 posts and I would like to display 5 and then under these are link to another 5. Or if this isn't possible, what direction I should look?
Currently I'm displaying data like that (this is only for title as I groomed it to be shorter for putting it here):
add_shortcode('title-snippet', 'wpc_shortcode_title');
function wpc_shortcode_title() {
$args = array( 'numberposts' => '1000' );
$recent_posts = wp_get_recent_posts( $args );
$html = '<div></div>';
for($x = 0; $x < count($recent_posts); $x++) {
$html .= '
<div class="vce-text-block">
<div class="vce-text-block-wrapper vce">
<p>
<span style="color: #ffffff; font-family: Playfair Display;">
<span style="font-size: 21.3333px;">
'.$recent_posts[$x]["post_title"].'
</span>
</span>
</p>
</div>
</div>
';
}
return <<<HTML
$html
HTML;
}