Pagination not working/displaying
-
Hello,
I’ve set up a page page-stream.php which displays all “posts” ever made from all custom post types arranged by month.
It sort of works, but only if you set it to display all which is not ideal considering we have tens of thousands of posts.
Now, at the moment, I’ve set posts per page to 100, however pagination does not appear. How would I go about fixing this.
Below is functions.php function for the timeline
function timeline_month() { $months = array(); $posts = get_posts(array( 'showposts' => 100, 'orderby' => 'post_date', 'order' => 'DESC', 'paged' => $paged, 'post_type' => array('post', 'audio', 'releases', 'videos', 'events', 'merchandise'), )); foreach($posts as $post) { $months[date('F Y', strtotime($post->post_date))][] = $post; } return $months; }
and below is the entire page-stream.php
<?php /* Template Name: stream */ ?> <?php get_header(); ?> </div> <div class="pagetitle"> <h1>Grime Forum Time Line</h1> </div> <div class="timelinewrap"> <?php foreach(timeline_month() as $months => $posts) : ?> <div class="timeline-month"><?php echo $months; ?></div> <?php foreach($posts as $post) : setup_postdata($post); ?> <div class="timelinepost"> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </div> <?php endforeach; ?> <?php endforeach; ?> </div> <?php if(function_exists('wp_paginate')) { wp_paginate(); } ?> <div> <?php get_footer(); ?>
and heres link to the page https://www.grimeforum.com/timeline
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Pagination not working/displaying’ is closed to new replies.