| | |
| | | 'offset' => ($page - 1) * $per_page, |
| | | 'meta_key' => BASE.'date_modified', |
| | | 'meta_type' => 'DATETIME', |
| | | 'orderby' => 'meta_value' |
| | | 'orderby' => 'meta_value', |
| | | 'order' => 'desc', |
| | | ]); |
| | | $cache = Cache::for($this->slug); |
| | | |
| | | $max = get_terms([ |
| | | 'taxonomy' => $this->based, |
| | | 'fields' => 'ids', |
| | | 'number' => 0, |
| | | 'hide_empty' => true |
| | | ]); |
| | | $max = count($max??[]); |
| | | $cache = Cache::for($this->slug)->connect('taxonomy'); |
| | | $max = $cache->remember( |
| | | 'max', |
| | | function () { |
| | | $max = get_terms([ |
| | | 'taxonomy' => $this->based, |
| | | 'fields' => 'ids', |
| | | 'number' => 0, |
| | | 'hide_empty' => true |
| | | ]); |
| | | return count($max??[]); |
| | | } |
| | | ); |
| | | |
| | | |
| | | $totalPages = floor($max/$per_page); |
| | | |
| | | global $wp; |
| | |
| | | $page < $totalPages ? '<a href="'.add_query_arg('tp', $page+1, $current).'" title="Next Page" class="btn">'.jvbIcon('arrow-circle-right').'<span class="screen-reader-text">Next Page</span></a>' : '', |
| | | ); |
| | | |
| | | |
| | | $out = $nav. Cache::for($this->slug)->remember( |
| | | $cache->generateKey(['type' =>'contentArchive', ... $args]), |
| | | function() use ($args) { |
| | |
| | | $method = BASE.'render_'.$this->slug.'_content'; |
| | | if ($items && !is_wp_error($items)) { |
| | | foreach ($items as $termID) { |
| | | $meta = Meta::forTerm($termID); |
| | | if (function_exists($method)) { |
| | | $out[] = $method($termID); |
| | | continue; |