Can't get it to work on my theme
-
Hi there,
I can’t really get it to work on my theme.
My theme’s content is
<div id="photos"> <?php while ( have_posts() ) : the_post(); ?> <img src="<?php $url = get_post_thumbnail_id(); $url = wp_get_attachment_image_src($url,'medium'); $url = $url[0]; echo $url; ?>"> <?php endwhile; ?> </div>
So basically all the home page shows are the featured images, since it’s a gallery.
Then as my navigation I have:
<div id="pagination"> <?php if(function_exists('wpex_pagination')) { wpex_pagination(); } ?> </div>
Which calls the function:
if ( !function_exists( 'wpex_pagination' ) ) { function wpex_pagination() { $prev_arrow = is_rtl() ? '→' : '←'; $next_arrow = is_rtl() ? '←' : '→'; global $wp_query; $total = $wp_query->max_num_pages; $big = 999999999; // need an unlikely integer if( $total > 1 ) { if( !$current_page = get_query_var('paged') ) $current_page = 1; if( get_option('permalink_structure') ) { $format = 'page/%#%/'; } else { $format = '&paged=%#%'; } echo paginate_links(array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => $format, 'current' => max( 1, get_query_var('paged') ), 'total' => $total, 'mid_size' => 3, 'type' => 'list', 'prev_text' => $prev_arrow, 'next_text' => $next_arrow, ) ); } } }
And outputs:
<div id="pagination" class="clear right"> <ul class="page-numbers"> <li> <span class="page-numbers current">1</span> </li> <li> <a class="page-numbers" href="https://localhost/?paged=2">2</a> </li> <li> <a class="page-numbers" href="https://localhost/?paged=3">3</a> </li> <li> <a class="next page-numbers" href="https://localhost/?paged=2">→</a> </li> </ul> </div>
So what should my configuration be?
Thanks!
- The topic ‘Can't get it to work on my theme’ is closed to new replies.