pagination.php created to handle the multiple uses of the function.

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-08-28 02:24:22 -07:00
parent ada5a72e44
commit e318666211
8 changed files with 35 additions and 87 deletions

View File

@ -137,19 +137,8 @@
<?php endif; ?>
<?php if(function_exists('wp_pagenavi')) { ?>
<div id="wp-paginav">
<?php wp_pagenavi(); ?>
<div class="clear"></div>
</div>
<?php } else { ?>
<div id="pagenav">
<div class="pagenav-right"><?php previous_posts_link('Newer Entries &uarr;') ?></div>
<div class="pagenav-left"><?php next_posts_link('&darr; Previous Entries') ?></div>
<div class="clear"></div>
</div>
<?php } ?>
<div class="clear"></div>
<?php comicpress_pagination(); ?>
</div>
</div>

View File

@ -68,18 +68,8 @@
</table>
</ol>
<?php if(function_exists('wp_pagenavi')) { ?>
<div id="wp-paginav">
<?php wp_pagenavi(); ?>
<div class="clear"></div>
</div>
<?php } else { ?>
<div class="pagenav">
<div class="pagenav-right"><?php previous_posts_link('Newer Entries &uarr;') ?></div>
<div class="pagenav-left"><?php next_posts_link('&darr; Previous Entries') ?></div>
<div class="clear"></div>
</div>
<?php } ?>
<?php comicpress_pagination(); ?>
<?php } ?>
</div>
<?php } ?>

View File

@ -36,22 +36,9 @@ Template Name: Blog
display_blog_post();
endwhile; ?>
endwhile;
<?php if(function_exists('wp_pagenavi')) { ?>
<div id="wp-paginav">
<?php wp_pagenavi(); ?>
<div class="clear"></div>
</div>
<?php } else { ?>
<div id="pagenav">
<div class="pagenav-right"><?php previous_posts_link('Newer Entries &uarr;') ?></div>
<div class="pagenav-left"><?php next_posts_link('&darr; Previous Entries') ?></div>
<div class="clear"></div>
</div>
<?php } ?>
<div class="clear"></div>
comicpress_pagination(); ?>
<?php endif; ?>
<?php get_sidebar('underblog'); ?>

View File

@ -129,6 +129,7 @@ require_once(get_template_directory() . '/widgets/comicblogpost.php');
require_once(get_template_directory() . '/functions/displaycomic.php');
require_once(get_template_directory() . '/functions/displaycomicpost.php');
require_once(get_template_directory() . '/functions/displayblogpost.php');
require_once(get_template_directory() . '/functions/pagination.php');
require_once(get_template_directory() . '/functions/adminnotes.php');
require_once(get_template_directory() . '/functions/checkbrowser.php');
require_once(get_template_directory() . '/functions/searchcustomfields.php');

17
functions/pagination.php Normal file
View File

@ -0,0 +1,17 @@
<?php
function comicpress_pagination() {
global $post, $wp_query;
if(function_exists('wp_pagenavi')) { ?>
<div id="wp-paginav">
<?php wp_pagenavi(); ?>
<div class="clear"></div>
</div>
<?php } else { ?>
<div id="pagenav">
<div class="pagenav-right"><?php previous_posts_link('Newer Entries &uarr;') ?></div>
<div class="pagenav-left"><?php next_posts_link('&darr; Previous Entries') ?></div>
<div class="clear"></div>
</div>
<?php }
} ?>

View File

@ -85,26 +85,13 @@ if ($disable_blog_frontpage == 'no') {
display_blog_post();
endwhile; ?>
endwhile;
comicpress_pagination();
}
} ?>
<?php if(function_exists('wp_pagenavi')) { ?>
<div id="wp-paginav">
<?php wp_pagenavi(); ?>
<div class="clear"></div>
</div>
<?php } else { ?>
<div id="pagenav">
<div class="pagenav-right"><?php previous_posts_link('Newer Entries &uarr;') ?></div>
<div class="pagenav-left"><?php next_posts_link('&darr; Previous Entries') ?></div>
<div class="clear"></div>
</div>
<?php } ?>
<div class="clear"></div>
<?php } } ?>
<?php get_sidebar('underblog'); ?>
<?php get_sidebar('underblog'); ?>
</div>
</div>

View File

@ -121,20 +121,9 @@ $count = $tmp_search->post_count;
<?php endif; ?>
<?php if(function_exists('wp_pagenavi')) { ?>
<div id="wp-paginav">
<?php wp_pagenavi(); ?>
<div class="clear"></div>
</div>
<?php } else { ?>
<div id="pagenav">
<div class="pagenav-right"><?php previous_posts_link('Newer Entries &uarr;') ?></div>
<div class="pagenav-left"><?php next_posts_link('&darr; Previous Entries') ?></div>
<div class="clear"></div>
</div>
<?php } ?>
<div class="clear"></div>
</div>
<?php comicpress_pagination(); ?>
</div>
</div>
</div>

View File

@ -120,19 +120,7 @@ $count = $tmp_search->post_count;
<?php endif; ?>
<?php if(function_exists('wp_pagenavi')) { ?>
<div id="wp-paginav">
<?php wp_pagenavi(); ?>
<div class="clear"></div>
</div>
<?php } else { ?>
<div id="pagenav">
<div class="pagenav-right"><?php previous_posts_link('Newer Entries &uarr;') ?></div>
<div class="pagenav-left"><?php next_posts_link('&darr; Previous Entries') ?></div>
<div class="clear"></div>
</div>
<?php } ?>
<div class="clear"></div>
<?php comicpress_pagination(); ?>
</div>
</div>
</div>