for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
function podium_pagination()
{
global $wp_query;
global
Instead of relying on global state, we recommend one of these alternatives:
function myFunction($a, $b) { // Do something }
class MyClass { private $a; private $b; public function __construct($a, $b) { $this->a = $a; $this->b = $b; } public function myFunction() { // Do something } }
$next_arrow = is_rtl() ? '<i title="Next Posts" class="fas fa-chevron-left"></i>' : '<i title="Next Posts" class="fas fa-chevron-right"></i>';
$prev_arrow = is_rtl() ? '<i title="Previous Posts" class="fas fa-chevron-right"></i>' : '<i title="Previous Posts" class="fas fa-chevron-left"></i>';
$total = $wp_query->max_num_pages;
$big = 999999999; // This neeFds to be an unlikely integer
// For more options and info view the docs for paginate_links()
// http://codex.wordpress.org/Function_Reference/paginate_links
$paginate_links = paginate_links([
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
'current' => max(1, get_query_var('paged')),
'total' => $total,
'show_all' => false,
'prev_text' => $prev_arrow,
'next_text' => $next_arrow,
'type' => 'list'
]);
// Display the pagination if more than one page is found
if ($paginate_links) {
echo '<div class="pagination">';
echo $paginate_links;
echo '</div>';
}
Instead of relying on
globalstate, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state