Pagination not working - FrontPage
I'm trying to add pagination through function.php. No Output! What I'm missing?
function simpleblog() {
$query = 'posts_per_page=6';
$queryObject = new WP_Query($query);
// The Loop...
if ($queryObject-have_posts()) {
while ($queryObject-have_posts()) {
$queryObject-the_post();
//the_title();
//the_content();
get_template_part( 'content' );
echo 'hr class=empty-space-hr';
}
} else {
//no post found
}
echo'div class=pagination';
echo paginate_links( array(
'base' = str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ),
'total' = $query-max_num_pages,
'current' = max( 1, get_query_var( 'paged' ) ),
'format' = '?paged=%#%',
'show_all' = false,
'type' = 'plain',
'end_size' = 2,
'mid_size' = 1,
'prev_next' = true,
'prev_text' = sprintf( 'i/i %1$s', __( 'Newer Posts', 'text-domain' ) ),
'next_text' = sprintf( '%1$s i/i', __( 'Older Posts', 'text-domain' ) ),
'add_args' = false,
'add_fragment' = '',
) );
echo '/div';
/* Restore original Post Data */
wp_reset_postdata();
}
add_shortcode( 'simpleblog', 'simpleblog' );
Topic paginate-links shortcode functions Wordpress
Category Web