WP-Paginate - Version 1.3.2

Version Description

  • Tested with WordPress 4.7
Download this release

Release Info

Developer AlanP57
Plugin Icon 128x128 WP-Paginate
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.3.1 to 1.3.2

Files changed (2) hide show
  1. readme.txt +59 -53
  2. wp-paginate.php +368 -367
readme.txt CHANGED
@@ -1,19 +1,17 @@
1
  === WP-Paginate ===
2
- Contributors: StudioFuel, emartin24
3
  Tags: paginate, pagination, navigation, page, wp-paginate, comments, rtl, seo, usability
4
  Requires at least: 2.6.0 (2.7.0 for comments pagination)
5
- Tested up to: 4.1
6
- Stable tag: 1.3.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
-
10
  WP-Paginate is a simple and flexible pagination plugin which provides users with better navigation on your WordPress site.
11
 
12
  == Description ==
13
 
14
  = Latest News =
15
- > I am happy to announce that, effective December 15, 2014, Noah Cinquini and the team at Studio Fuel (studiofuel.com) have offered to take over maintenance, support, and development of WP-Paginate! A huge thanks to Noah and all of the people that have used WP-Paginate over the last 5 years!
16
-
17
  WP-Paginate is a simple and flexible pagination plugin which provides users with better navigation on your WordPress site.
18
 
19
  In addition to increasing the user experience for your visitors, it has also been widely reported that pagination increases the SEO of your site by providing more links to your content.
@@ -21,7 +19,7 @@ In addition to increasing the user experience for your visitors, it has also bee
21
  Starting in version 1.1, WP-Paginate can also be used to paginate post comments!
22
 
23
  Translations: http://plugins.svn.wordpress.org/wp-paginate/I18n (check the version number for the correct file)
24
-
25
  == Installation ==
26
 
27
  *Install and Activate*
@@ -37,55 +35,74 @@ For posts pagination:
37
 
38
  Examples:
39
 
40
- For the `twentytwelve` theme, in `index.php`, replace:
41
 
42
- <?php twentytwelve_content_nav( 'nav-below' ); ?>
 
 
 
 
43
 
44
  With:
45
 
46
- <?php if(function_exists('wp_paginate')) {
47
- wp_paginate();
48
- }
49
- else {
50
- twentytwelve_content_nav( 'nav-below' );
51
- }
52
- ?>
 
 
53
 
54
- For the `twentythirteen` theme, in `index.php`, replace:
55
 
56
- <?php twentythirteen_paging_nav(); ?>
 
 
 
 
57
 
58
  With:
59
 
60
- <?php if(function_exists('wp_paginate')) {
61
- wp_paginate();
62
- }
63
- else {
64
- twentythirteen_paging_nav();
65
- }
66
- ?>
 
 
67
 
68
- For the `twentyfourteen` theme, in `index.php`, replace:
69
 
70
- twentyfourteen_paging_nav();
 
 
 
 
71
 
72
  With:
73
 
74
- if(function_exists('wp_paginate')) {
75
- wp_paginate();
76
- }
77
- else {
78
- twentyfourteen_paging_nav();
79
- }
 
 
 
80
 
81
  For comments pagination:
82
  1) Open the theme file(s) where you'd like comments pagination to be used. Usually this is the `comments.php` file.
83
 
84
  2) Replace your existing `previous_comments_link()` and `next_comments_link()` code block with the following:
85
 
86
- <?php if(function_exists('wp_paginate_comments')) {
87
- wp_paginate_comments();
88
- } ?>
89
 
90
 
91
  *Configure*
@@ -130,28 +147,17 @@ You can even control the current page and number of pages with:
130
 
131
  Example (also applies to `wp_paginate_comments()`):
132
 
133
- <?php if(function_exists('wp_paginate')) {
134
- wp_paginate('range=4&anchor=2&nextpage=Next&previouspage=Previous');
135
- } ?>
136
 
137
 
138
  = How can I style the comments pagination differently than the posts pagination? =
139
 
140
- When calling `wp_paginate_comments()`, WP-Paginate adds an extra class to the `ol` element, `wp-paginate-comments`.
141
-
142
- This allows you to use the `.wp-paginate-comments` styles, already in `wp-paginate.css`, to override the default styles.
143
-
144
- == Screenshots ==
145
-
146
- 1. An example of the WP-Paginate display using the default options and styling
147
- 2. The WP-Paginate admin settings page
148
-
149
-
150
- == Upgrade Notice ==
151
-
152
- N/A
153
 
154
- == Changelog ==
 
155
 
156
  = 1.3.1 =
157
  * Fixed bug that prevented a wp-paginate.css stylesheet from loading from a child theme (reported by sunamumaya)
1
  === WP-Paginate ===
2
+ Contributors: maxfoundry, emartin24, AlanP57
3
  Tags: paginate, pagination, navigation, page, wp-paginate, comments, rtl, seo, usability
4
  Requires at least: 2.6.0 (2.7.0 for comments pagination)
5
+ Tested up to: 4.7
6
+ Stable tag: 1.3.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
  WP-Paginate is a simple and flexible pagination plugin which provides users with better navigation on your WordPress site.
11
 
12
  == Description ==
13
 
14
  = Latest News =
 
 
15
  WP-Paginate is a simple and flexible pagination plugin which provides users with better navigation on your WordPress site.
16
 
17
  In addition to increasing the user experience for your visitors, it has also been widely reported that pagination increases the SEO of your site by providing more links to your content.
19
  Starting in version 1.1, WP-Paginate can also be used to paginate post comments!
20
 
21
  Translations: http://plugins.svn.wordpress.org/wp-paginate/I18n (check the version number for the correct file)
22
+
23
  == Installation ==
24
 
25
  *Install and Activate*
35
 
36
  Examples:
37
 
38
+ For the `Twenty Seventeen` theme, in `index.php`, replace:
39
 
40
+ the_posts_pagination( array(
41
+ 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
42
+ 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
43
+ 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
44
+ ) );
45
 
46
  With:
47
 
48
+ if(function_exists('wp_paginate')):
49
+ wp_paginate();
50
+ else :
51
+ the_posts_pagination( array(
52
+ 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
53
+ 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
54
+ 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
55
+ ) );
56
+ endif;
57
 
58
+ For the `Twenty Sixteen` theme, in `index.php`, replace:
59
 
60
+ the_posts_pagination( array(
61
+ 'prev_text' => __( 'Previous page', 'twentysixteen' ),
62
+ 'next_text' => __( 'Next page', 'twentysixteen' ),
63
+ 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
64
+ ) );
65
 
66
  With:
67
 
68
+ if(function_exists('wp_paginate')):
69
+ wp_paginate();
70
+ else :
71
+ the_posts_pagination( array(
72
+ 'prev_text' => __( 'Previous page', 'twentysixteen' ),
73
+ 'next_text' => __( 'Next page', 'twentysixteen' ),
74
+ 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
75
+ ) );
76
+ endif;
77
 
78
+ For the `Twenty Fifteen` theme, in `index.php`, replace:
79
 
80
+ the_posts_pagination( array(
81
+ 'prev_text' => __( 'Previous page', 'twentyfifteen' ),
82
+ 'next_text' => __( 'Next page', 'twentyfifteen' ),
83
+ 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
84
+ ) );
85
 
86
  With:
87
 
88
+ if(function_exists('wp_paginate')):
89
+ wp_paginate();
90
+ else :
91
+ the_posts_pagination( array(
92
+ 'prev_text' => __( 'Previous page', 'twentyfifteen' ),
93
+ 'next_text' => __( 'Next page', 'twentyfifteen' ),
94
+ 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
95
+ ) );
96
+ endif;
97
 
98
  For comments pagination:
99
  1) Open the theme file(s) where you'd like comments pagination to be used. Usually this is the `comments.php` file.
100
 
101
  2) Replace your existing `previous_comments_link()` and `next_comments_link()` code block with the following:
102
 
103
+ <?php if(function_exists('wp_paginate_comments')) {
104
+ wp_paginate_comments();
105
+ } ?>
106
 
107
 
108
  *Configure*
147
 
148
  Example (also applies to `wp_paginate_comments()`):
149
 
150
+ <?php if(function_exists('wp_paginate')) {
151
+ wp_paginate('range=4&anchor=2&nextpage=Next&previouspage=Previous');
152
+ } ?>
153
 
154
 
155
  = How can I style the comments pagination differently than the posts pagination? =
156
 
157
+ When calling `wp_paginate_comments()`, WP-Paginate adds an extra class to the `ol` element, `wp-paginate-comments`.== Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
158
 
159
+ = 1.3.2 =
160
+ * Tested with WordPress 4.7
161
 
162
  = 1.3.1 =
163
  * Fixed bug that prevented a wp-paginate.css stylesheet from loading from a child theme (reported by sunamumaya)
wp-paginate.php CHANGED
@@ -1,299 +1,300 @@
1
  <?php
2
  /*
3
  Plugin Name: WP-Paginate
4
- Plugin URI: http://www.studiofuel.com/wp-paginate/
5
  Description: A simple and flexible pagination plugin for WordPress posts and comments.
6
- Version: 1.3.1
7
- Author: Noah Cinquini
8
- Author URI: http://www.studiofuel.com
9
  */
10
 
11
- /* Copyright 2014 Studio Fuel (http://www.studiofuel.com)
12
 
13
- Plugin originally created by Eric Martin (http://www.ericmmartin.com)
 
14
 
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License as published by
17
- the Free Software Foundation; either version 2 of the License, or
18
- (at your option) any later version.
19
 
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
 
25
- You should have received a copy of the GNU General Public License
26
- along with this program; if not, write to the Free Software
27
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
  */
29
 
30
  /**
31
  * Set the wp-content and plugin urls/paths
32
  */
33
  if (!defined('WP_CONTENT_URL'))
34
- define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
35
  if (!defined('WP_CONTENT_DIR'))
36
- define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
37
  if (!defined('WP_PLUGIN_URL') )
38
- define('WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins');
39
  if (!defined('WP_PLUGIN_DIR') )
40
- define('WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins');
41
 
42
  if (!class_exists('WPPaginate')) {
43
- class WPPaginate {
44
- /**
45
- * @var string The plugin version
46
- */
47
- var $version = '1.3.1';
48
-
49
- /**
50
- * @var string The options string name for this plugin
51
- */
52
- var $optionsName = 'wp_paginate_options';
53
-
54
- /**
55
- * @var string $localizationDomain Domain used for localization
56
- */
57
- var $localizationDomain = 'wp-paginate';
58
-
59
- /**
60
- * @var string $pluginurl The url to this plugin
61
- */
62
- var $pluginurl = '';
63
- /**
64
- * @var string $pluginpath The path to this plugin
65
- */
66
- var $pluginpath = '';
67
-
68
- /**
69
- * @var array $options Stores the options for this plugin
70
- */
71
- var $options = array();
72
-
73
- var $type = 'posts';
74
-
75
- /**
76
- * Constructor
77
- */
78
- function __construct() {
79
- $name = dirname(plugin_basename(__FILE__));
80
-
81
- //Language Setup
82
- load_plugin_textdomain($this->localizationDomain, false, "$name/I18n/");
83
-
84
- //"Constants" setup
85
- $this->pluginurl = plugins_url($name) . "/";
86
- $this->pluginpath = WP_PLUGIN_DIR . "/$name/";
87
-
88
- //Initialize the options
89
- $this->get_options();
90
-
91
- //Actions
92
- add_action('admin_menu', array(&$this, 'admin_menu_link'));
93
-
94
- if ($this->options['css'])
95
- add_action('wp_print_styles', array(&$this, 'wp_paginate_css'));
96
- }
97
-
98
- /**
99
- * Pagination based on options/args
100
- */
101
- function paginate($args = false) {
102
- if ($this->type === 'comments' && !get_option('page_comments'))
103
- return;
104
-
105
- $r = wp_parse_args($args, $this->options);
106
- extract($r, EXTR_SKIP);
107
-
108
- if (!isset($page) && !isset($pages)) {
109
- global $wp_query;
110
-
111
- if ($this->type === 'posts') {
112
- $page = get_query_var('paged');
113
- $posts_per_page = intval(get_query_var('posts_per_page'));
114
- $pages = intval(ceil($wp_query->found_posts / $posts_per_page));
115
- }
116
- else {
117
- $page = get_query_var('cpage');
118
- $comments_per_page = get_option('comments_per_page');
119
- $pages = get_comment_pages_count();
120
- }
121
- $page = !empty($page) ? intval($page) : 1;
122
- }
123
-
124
- $prevlink = ($this->type === 'posts')
125
- ? esc_url(get_pagenum_link($page - 1))
126
- : get_comments_pagenum_link($page - 1);
127
- $nextlink = ($this->type === 'posts')
128
- ? esc_url(get_pagenum_link($page + 1))
129
- : get_comments_pagenum_link($page + 1);
130
-
131
- $output = stripslashes($before);
132
- if ($pages > 1) {
133
- $output .= sprintf('<ol class="wp-paginate%s">', ($this->type === 'posts') ? '' : ' wp-paginate-comments');
134
- if (strlen(stripslashes($title)) > 0) {
135
- $output .= sprintf('<li><span class="title">%s</span></li>', stripslashes($title));
136
- }
137
- $ellipsis = "<li><span class='gap'>...</span></li>";
138
-
139
- if ($page > 1 && !empty($previouspage)) {
140
- $output .= sprintf('<li><a href="%s" class="prev">%s</a></li>', $prevlink, stripslashes($previouspage));
141
- }
142
-
143
- $min_links = $range * 2 + 1;
144
- $block_min = min($page - $range, $pages - $min_links);
145
- $block_high = max($page + $range, $min_links);
146
- $left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;
147
- $right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;
148
-
149
- if ($left_gap && !$right_gap) {
150
- $output .= sprintf('%s%s%s',
151
- $this->paginate_loop(1, $anchor),
152
- $ellipsis,
153
- $this->paginate_loop($block_min, $pages, $page)
154
- );
155
- }
156
- else if ($left_gap && $right_gap) {
157
- $output .= sprintf('%s%s%s%s%s',
158
- $this->paginate_loop(1, $anchor),
159
- $ellipsis,
160
- $this->paginate_loop($block_min, $block_high, $page),
161
- $ellipsis,
162
- $this->paginate_loop(($pages - $anchor + 1), $pages)
163
- );
164
- }
165
- else if ($right_gap && !$left_gap) {
166
- $output .= sprintf('%s%s%s',
167
- $this->paginate_loop(1, $block_high, $page),
168
- $ellipsis,
169
- $this->paginate_loop(($pages - $anchor + 1), $pages)
170
- );
171
- }
172
- else {
173
- $output .= $this->paginate_loop(1, $pages, $page);
174
- }
175
-
176
- if ($page < $pages && !empty($nextpage)) {
177
- $output .= sprintf('<li><a href="%s" class="next">%s</a></li>', $nextlink, stripslashes($nextpage));
178
- }
179
- $output .= "</ol>";
180
- }
181
- $output .= stripslashes($after);
182
-
183
- if ($pages > 1 || $empty) {
184
- echo $output;
185
- }
186
- }
187
-
188
- /**
189
- * Helper function for pagination which builds the page links.
190
- */
191
- function paginate_loop($start, $max, $page = 0) {
192
- $output = "";
193
- for ($i = $start; $i <= $max; $i++) {
194
- $p = ($this->type === 'posts') ? esc_url(get_pagenum_link($i)) : get_comments_pagenum_link($i);
195
- $output .= ($page == intval($i))
196
- ? "<li><span class='page current'>$i</span></li>"
197
- : "<li><a href='$p' title='$i' class='page'>$i</a></li>";
198
- }
199
- return $output;
200
- }
201
-
202
- function wp_paginate_css() {
203
- $name = "wp-paginate.css";
204
-
205
- if (false !== @file_exists(STYLESHEETPATH . "/$name")) {
206
- $css = get_stylesheet_directory_uri() . "/$name";
207
- }
208
- else {
209
- $css = $this->pluginurl . $name;
210
- }
211
- wp_enqueue_style('wp-paginate', $css, false, $this->version, 'screen');
212
-
213
- if (function_exists('is_rtl') && is_rtl()) {
214
- $name = "wp-paginate-rtl.css";
215
- if (false !== @file_exists(STYLESHEETPATH . "/$name")) {
216
- $css = get_stylesheet_directory_uri() . "/$name";
217
- }
218
- else {
219
- $css = $this->pluginurl . $name;
220
- }
221
- wp_enqueue_style('wp-paginate-rtl', $css, false, $this->version, 'screen');
222
- }
223
- }
224
-
225
- /**
226
- * Retrieves the plugin options from the database.
227
- * @return array
228
- */
229
- function get_options() {
230
- if (!$options = get_option($this->optionsName)) {
231
- $options = array(
232
- 'title' => 'Pages:',
233
- 'nextpage' => '&raquo;',
234
- 'previouspage' => '&laquo;',
235
- 'css' => true,
236
- 'before' => '<div class="navigation">',
237
- 'after' => '</div>',
238
- 'empty' => true,
239
- 'range' => 3,
240
- 'anchor' => 1,
241
- 'gap' => 3
242
- );
243
- update_option($this->optionsName, $options);
244
- }
245
- $this->options = $options;
246
- }
247
- /**
248
- * Saves the admin options to the database.
249
- */
250
- function save_admin_options(){
251
- return update_option($this->optionsName, $this->options);
252
- }
253
-
254
- /**
255
- * @desc Adds the options subpanel
256
- */
257
- function admin_menu_link() {
258
- add_options_page('WP-Paginate', 'WP-Paginate', 'manage_options', basename(__FILE__), array(&$this, 'admin_options_page'));
259
- add_filter('plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'filter_plugin_actions'), 10, 2 );
260
- }
261
-
262
- /**
263
- * @desc Adds the Settings link to the plugin activate/deactivate page
264
- */
265
- function filter_plugin_actions($links, $file) {
266
- $settings_link = '<a href="options-general.php?page=' . basename(__FILE__) . '">' . __('Settings', $this->localizationDomain) . '</a>';
267
- array_unshift($links, $settings_link); // before other links
268
-
269
- return $links;
270
- }
271
-
272
- /**
273
- * Adds settings/options page
274
- */
275
- function admin_options_page() {
276
- if (isset($_POST['wp_paginate_save'])) {
277
- if (wp_verify_nonce($_POST['_wpnonce'], 'wp-paginate-update-options')) {
278
- $this->options['title'] = $_POST['title'];
279
- $this->options['previouspage'] = $_POST['previouspage'];
280
- $this->options['nextpage'] = $_POST['nextpage'];
281
- $this->options['before'] = $_POST['before'];
282
- $this->options['after'] = $_POST['after'];
283
- $this->options['empty'] = (isset($_POST['empty']) && $_POST['empty'] === 'on') ? true : false;
284
- $this->options['css'] = (isset($_POST['css']) && $_POST['css'] === 'on') ? true : false;
285
- $this->options['range'] = intval($_POST['range']);
286
- $this->options['anchor'] = intval($_POST['anchor']);
287
- $this->options['gap'] = intval($_POST['gap']);
288
-
289
- $this->save_admin_options();
290
-
291
- echo '<div class="updated"><p>' . __('Success! Your changes were successfully saved!', $this->localizationDomain) . '</p></div>';
292
- }
293
- else {
294
- echo '<div class="error"><p>' . __('Whoops! There was a problem with the data you posted. Please try again.', $this->localizationDomain) . '</p></div>';
295
- }
296
- }
297
  ?>
298
 
299
  <div class="wrap">
@@ -301,128 +302,128 @@ if (!class_exists('WPPaginate')) {
301
  <h2>WP-Paginate</h2>
302
  <form method="post" id="wp_paginate_options">
303
  <?php wp_nonce_field('wp-paginate-update-options'); ?>
304
- <table class="form-table">
305
- <tr valign="top">
306
- <th scope="row"><?php _e('Pagination Label:', $this->localizationDomain); ?></th>
307
- <td><input name="title" type="text" id="title" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['title'])); ?>"/>
308
- <span class="description"><?php _e('The text/HTML to display before the list of pages.', $this->localizationDomain); ?></span></td>
309
- </tr>
310
- <tr valign="top">
311
- <th scope="row"><?php _e('Previous Page:', $this->localizationDomain); ?></th>
312
- <td><input name="previouspage" type="text" id="previouspage" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['previouspage'])); ?>"/>
313
- <span class="description"><?php _e('The text/HTML to display for the previous page link.', $this->localizationDomain); ?></span></td>
314
- </tr>
315
- <tr valign="top">
316
- <th scope="row"><?php _e('Next Page:', $this->localizationDomain); ?></th>
317
- <td><input name="nextpage" type="text" id="nextpage" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['nextpage'])); ?>"/>
318
- <span class="description"><?php _e('The text/HTML to display for the next page link.', $this->localizationDomain); ?></span></td>
319
- </tr>
320
- </table>
321
- <p>&nbsp;</p>
322
- <h3><?php _e('Advanced Settings', $this->localizationDomain); ?></h3>
323
- <table class="form-table">
324
- <tr valign="top">
325
- <th scope="row"><?php _e('Before Markup:', $this->localizationDomain); ?></th>
326
- <td><input name="before" type="text" id="before" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['before'])); ?>"/>
327
- <span class="description"><?php _e('The HTML markup to display before the pagination code.', $this->localizationDomain); ?></span></td>
328
- </tr>
329
- <tr valign="top">
330
- <th scope="row"><?php _e('After Markup:', $this->localizationDomain); ?></th>
331
- <td><input name="after" type="text" id="after" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['after'])); ?>"/>
332
- <span class="description"><?php _e('The HTML markup to display after the pagination code.', $this->localizationDomain); ?></span></td>
333
- </tr>
334
- <tr valign="top">
335
- <th scope="row"><?php _e('Markup Display:', $this->localizationDomain); ?></th>
336
- <td><label for="empty">
337
- <input type="checkbox" id="empty" name="empty" <?php echo ($this->options['empty'] === true) ? "checked='checked'" : ""; ?>/> <?php _e('Show Before Markup and After Markup, even if the page list is empty?', $this->localizationDomain); ?></label></td>
338
- </tr>
339
- <tr valign="top">
340
- <th scope="row"><?php _e('WP-Paginate CSS File:', $this->localizationDomain); ?></th>
341
- <td><label for="css">
342
- <input type="checkbox" id="css" name="css" <?php echo ($this->options['css'] === true) ? "checked='checked'" : ""; ?>/> <?php printf(__('Include the default stylesheet wp-paginate.css? WP-Paginate will first look for <code>wp-paginate.css</code> in your theme directory (<code>themes/%s</code>).', $this->localizationDomain), get_template()); ?></label></td>
343
- </tr>
344
- <tr valign="top">
345
- <th scope="row"><?php _e('Page Range:', $this->localizationDomain); ?></th>
346
- <td>
347
- <select name="range" id="range">
348
- <?php for ($i=1; $i<=10; $i++) : ?>
349
- <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['range']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>
350
- <?php endfor; ?>
351
- </select>
352
- <span class="description"><?php _e('The number of page links to show before and after the current page. Recommended value: 3', $this->localizationDomain); ?></span></td>
353
- </tr>
354
- <tr valign="top">
355
- <th scope="row"><?php _e('Page Anchors:', $this->localizationDomain); ?></th>
356
- <td>
357
- <select name="anchor" id="anchor">
358
- <?php for ($i=0; $i<=10; $i++) : ?>
359
- <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['anchor']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>
360
- <?php endfor; ?>
361
- </select>
362
- <span class="description"><?php _e('The number of links to always show at beginning and end of pagination. Recommended value: 1', $this->localizationDomain); ?></span></td>
363
- </tr>
364
- <tr valign="top">
365
- <th scope="row"><?php _e('Page Gap:', $this->localizationDomain); ?></th>
366
- <td>
367
- <select name="gap" id="gap">
368
- <?php for ($i=1; $i<=10; $i++) : ?>
369
- <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['gap']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>
370
- <?php endfor; ?>
371
- </select>
372
- <span class="description"><?php _e('The minimum number of pages in a gap before an ellipsis (...) is added. Recommended value: 3', $this->localizationDomain); ?></span></td>
373
- </tr>
374
- </table>
375
- <p class="submit">
376
- <input type="submit" value="Save Changes" name="wp_paginate_save" class="button-primary" />
377
- </p>
378
  </form>
379
  <h2><?php _e('Need Support?', $this->localizationDomain); ?></h2>
380
  <p><?php printf(__('For questions, issues or feature requests, please post them in the %s and make sure to tag the post with wp-paginate.', $this->localizationDomain), '<a href="https://wordpress.org/support/plugin/wp-paginate">WordPress Forum</a>'); ?></p>
381
  <h2><?php _e('Want To Contribute?', $this->localizationDomain); ?></h2>
382
  <p><?php _e('If you would like to contribute, the following is a list of ways you can help:', $this->localizationDomain); ?></p>
383
  <ul>
384
- <li>&raquo; <?php _e('Translate WP-Paginate into your language', $this->localizationDomain); ?></li>
385
- <li>&raquo; <?php _e('Blog about or link to WP-Paginate so others can find out about it', $this->localizationDomain); ?></li>
386
- <li>&raquo; <?php _e('Report issues, provide feedback, request features, etc.', $this->localizationDomain); ?></li>
387
- <li>&raquo; <a href="https://wordpress.org/support/view/plugin-reviews/wp-paginate"><?php _e('Review WP-Paginate on the WordPress Plugins Page', $this->localizationDomain); ?></a></li>
388
  </ul>
389
- <h2><?php _e('Other Links', $this->localizationDomain); ?></h2>
390
  <ul>
391
- <li>&raquo; <a href='https://github.com/studiofuel/wp-paginate'>WP-Paginate</a> on GitHub</li>
392
- <li>&raquo; <a href="http://www.studiofuel.com/simplemodal-contact-form-smcf/">SimpleModal Contact Form (SMCF) - WordPress Plugin</a></li>
393
- <li>&raquo; <a href="http://www.studiofuel.com/simplemodal-login/">SimpleModal Login - WordPress Plugin</a></li>
394
  </ul>
395
  </div>
396
 
397
  <?php
398
- }
399
- }
400
  }
401
 
402
  //instantiate the class
403
  if (class_exists('WPPaginate')) {
404
- $wp_paginate = new WPPaginate();
405
  }
406
 
407
  /**
408
  * Pagination function to use for posts
409
  */
410
  function wp_paginate($args = false) {
411
- global $wp_paginate;
412
- $wp_paginate->type = 'posts';
413
- return $wp_paginate->paginate($args);
414
  }
415
 
416
  /**
417
  * Pagination function to use for post comments
418
  */
419
  function wp_paginate_comments($args = false) {
420
- global $wp_paginate;
421
- $wp_paginate->type = 'comments';
422
- return $wp_paginate->paginate($args);
423
  }
424
 
425
  /*
426
  * The format of this plugin is based on the following plugin template:
427
  * http://pressography.com/plugins/wordpress-plugin-template/
428
- */
1
  <?php
2
  /*
3
  Plugin Name: WP-Paginate
4
+ Plugin URI: https://wordpress.org/plugins/wp-paginate/
5
  Description: A simple and flexible pagination plugin for WordPress posts and comments.
6
+ Version: 1.3.2
7
+ Author: Max Foundry
8
+ Author URI: http://maxfoundry.com
9
  */
10
 
11
+ /* Copyright 2016 Max Foundry (http://www.maxfoundry.com)
12
 
13
+ Plugin originally created by Eric Martin (http://www.ericmmartin.com) and
14
+ and improved upon by Studio Fuels.
15
 
16
+ This program is free software; you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License as published by
18
+ the Free Software Foundation; either version 2 of the License, or
19
+ (at your option) any later version.
20
 
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
 
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program; if not, write to the Free Software
28
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
  */
30
 
31
  /**
32
  * Set the wp-content and plugin urls/paths
33
  */
34
  if (!defined('WP_CONTENT_URL'))
35
+ define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
36
  if (!defined('WP_CONTENT_DIR'))
37
+ define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
38
  if (!defined('WP_PLUGIN_URL') )
39
+ define('WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins');
40
  if (!defined('WP_PLUGIN_DIR') )
41
+ define('WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins');
42
 
43
  if (!class_exists('WPPaginate')) {
44
+ class WPPaginate {
45
+ /**
46
+ * @var string The plugin version
47
+ */
48
+ var $version = '1.3.1';
49
+
50
+ /**
51
+ * @var string The options string name for this plugin
52
+ */
53
+ var $optionsName = 'wp_paginate_options';
54
+
55
+ /**
56
+ * @var string $localizationDomain Domain used for localization
57
+ */
58
+ var $localizationDomain = 'wp-paginate';
59
+
60
+ /**
61
+ * @var string $pluginurl The url to this plugin
62
+ */
63
+ var $pluginurl = '';
64
+ /**
65
+ * @var string $pluginpath The path to this plugin
66
+ */
67
+ var $pluginpath = '';
68
+
69
+ /**
70
+ * @var array $options Stores the options for this plugin
71
+ */
72
+ var $options = array();
73
+
74
+ var $type = 'posts';
75
+
76
+ /**
77
+ * Constructor
78
+ */
79
+ function __construct() {
80
+ $name = dirname(plugin_basename(__FILE__));
81
+
82
+ //Language Setup
83
+ load_plugin_textdomain($this->localizationDomain, false, "$name/I18n/");
84
+
85
+ //"Constants" setup
86
+ $this->pluginurl = plugins_url($name) . "/";
87
+ $this->pluginpath = WP_PLUGIN_DIR . "/$name/";
88
+
89
+ //Initialize the options
90
+ $this->get_options();
91
+
92
+ //Actions
93
+ add_action('admin_menu', array(&$this, 'admin_menu_link'));
94
+
95
+ if ($this->options['css'])
96
+ add_action('wp_print_styles', array(&$this, 'wp_paginate_css'));
97
+ }
98
+
99
+ /**
100
+ * Pagination based on options/args
101
+ */
102
+ function paginate($args = false) {
103
+ if ($this->type === 'comments' && !get_option('page_comments'))
104
+ return;
105
+
106
+ $r = wp_parse_args($args, $this->options);
107
+ extract($r, EXTR_SKIP);
108
+
109
+ if (!isset($page) && !isset($pages)) {
110
+ global $wp_query;
111
+
112
+ if ($this->type === 'posts') {
113
+ $page = get_query_var('paged');
114
+ $posts_per_page = intval(get_query_var('posts_per_page'));
115
+ $pages = intval(ceil($wp_query->found_posts / $posts_per_page));
116
+ }
117
+ else {
118
+ $page = get_query_var('cpage');
119
+ $comments_per_page = get_option('comments_per_page');
120
+ $pages = get_comment_pages_count();
121
+ }
122
+ $page = !empty($page) ? intval($page) : 1;
123
+ }
124
+
125
+ $prevlink = ($this->type === 'posts')
126
+ ? esc_url(get_pagenum_link($page - 1))
127
+ : get_comments_pagenum_link($page - 1);
128
+ $nextlink = ($this->type === 'posts')
129
+ ? esc_url(get_pagenum_link($page + 1))
130
+ : get_comments_pagenum_link($page + 1);
131
+
132
+ $output = stripslashes($before);
133
+ if ($pages > 1) {
134
+ $output .= sprintf('<ol class="wp-paginate%s">', ($this->type === 'posts') ? '' : ' wp-paginate-comments');
135
+ if (strlen(stripslashes($title)) > 0) {
136
+ $output .= sprintf('<li><span class="title">%s</span></li>', stripslashes($title));
137
+ }
138
+ $ellipsis = "<li><span class='gap'>...</span></li>";
139
+
140
+ if ($page > 1 && !empty($previouspage)) {
141
+ $output .= sprintf('<li><a href="%s" class="prev">%s</a></li>', $prevlink, stripslashes($previouspage));
142
+ }
143
+
144
+ $min_links = $range * 2 + 1;
145
+ $block_min = min($page - $range, $pages - $min_links);
146
+ $block_high = max($page + $range, $min_links);
147
+ $left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;
148
+ $right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;
149
+
150
+ if ($left_gap && !$right_gap) {
151
+ $output .= sprintf('%s%s%s',
152
+ $this->paginate_loop(1, $anchor),
153
+ $ellipsis,
154
+ $this->paginate_loop($block_min, $pages, $page)
155
+ );
156
+ }
157
+ else if ($left_gap && $right_gap) {
158
+ $output .= sprintf('%s%s%s%s%s',
159
+ $this->paginate_loop(1, $anchor),
160
+ $ellipsis,
161
+ $this->paginate_loop($block_min, $block_high, $page),
162
+ $ellipsis,
163
+ $this->paginate_loop(($pages - $anchor + 1), $pages)
164
+ );
165
+ }
166
+ else if ($right_gap && !$left_gap) {
167
+ $output .= sprintf('%s%s%s',
168
+ $this->paginate_loop(1, $block_high, $page),
169
+ $ellipsis,
170
+ $this->paginate_loop(($pages - $anchor + 1), $pages)
171
+ );
172
+ }
173
+ else {
174
+ $output .= $this->paginate_loop(1, $pages, $page);
175
+ }
176
+
177
+ if ($page < $pages && !empty($nextpage)) {
178
+ $output .= sprintf('<li><a href="%s" class="next">%s</a></li>', $nextlink, stripslashes($nextpage));
179
+ }
180
+ $output .= "</ol>";
181
+ }
182
+ $output .= stripslashes($after);
183
+
184
+ if ($pages > 1 || $empty) {
185
+ echo $output;
186
+ }
187
+ }
188
+
189
+ /**
190
+ * Helper function for pagination which builds the page links.
191
+ */
192
+ function paginate_loop($start, $max, $page = 0) {
193
+ $output = "";
194
+ for ($i = $start; $i <= $max; $i++) {
195
+ $p = ($this->type === 'posts') ? esc_url(get_pagenum_link($i)) : get_comments_pagenum_link($i);
196
+ $output .= ($page == intval($i))
197
+ ? "<li><span class='page current'>$i</span></li>"
198
+ : "<li><a href='$p' title='$i' class='page'>$i</a></li>";
199
+ }
200
+ return $output;
201
+ }
202
+
203
+ function wp_paginate_css() {
204
+ $name = "wp-paginate.css";
205
+
206
+ if (false !== @file_exists(STYLESHEETPATH . "/$name")) {
207
+ $css = get_stylesheet_directory_uri() . "/$name";
208
+ }
209
+ else {
210
+ $css = $this->pluginurl . $name;
211
+ }
212
+ wp_enqueue_style('wp-paginate', $css, false, $this->version, 'screen');
213
+
214
+ if (function_exists('is_rtl') && is_rtl()) {
215
+ $name = "wp-paginate-rtl.css";
216
+ if (false !== @file_exists(STYLESHEETPATH . "/$name")) {
217
+ $css = get_stylesheet_directory_uri() . "/$name";
218
+ }
219
+ else {
220
+ $css = $this->pluginurl . $name;
221
+ }
222
+ wp_enqueue_style('wp-paginate-rtl', $css, false, $this->version, 'screen');
223
+ }
224
+ }
225
+
226
+ /**
227
+ * Retrieves the plugin options from the database.
228
+ * @return array
229
+ */
230
+ function get_options() {
231
+ if (!$options = get_option($this->optionsName)) {
232
+ $options = array(
233
+ 'title' => 'Pages:',
234
+ 'nextpage' => '&raquo;',
235
+ 'previouspage' => '&laquo;',
236
+ 'css' => true,
237
+ 'before' => '<div class="navigation">',
238
+ 'after' => '</div>',
239
+ 'empty' => true,
240
+ 'range' => 3,
241
+ 'anchor' => 1,
242
+ 'gap' => 3
243
+ );
244
+ update_option($this->optionsName, $options);
245
+ }
246
+ $this->options = $options;
247
+ }
248
+ /**
249
+ * Saves the admin options to the database.
250
+ */
251
+ function save_admin_options(){
252
+ return update_option($this->optionsName, $this->options);
253
+ }
254
+
255
+ /**
256
+ * @desc Adds the options subpanel
257
+ */
258
+ function admin_menu_link() {
259
+ add_options_page('WP-Paginate', 'WP-Paginate', 'manage_options', basename(__FILE__), array(&$this, 'admin_options_page'));
260
+ add_filter('plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'filter_plugin_actions'), 10, 2 );
261
+ }
262
+
263
+ /**
264
+ * @desc Adds the Settings link to the plugin activate/deactivate page
265
+ */
266
+ function filter_plugin_actions($links, $file) {
267
+ $settings_link = '<a href="options-general.php?page=' . basename(__FILE__) . '">' . __('Settings', $this->localizationDomain) . '</a>';
268
+ array_unshift($links, $settings_link); // before other links
269
+
270
+ return $links;
271
+ }
272
+
273
+ /**
274
+ * Adds settings/options page
275
+ */
276
+ function admin_options_page() {
277
+ if (isset($_POST['wp_paginate_save'])) {
278
+ if (wp_verify_nonce($_POST['_wpnonce'], 'wp-paginate-update-options')) {
279
+ $this->options['title'] = $_POST['title'];
280
+ $this->options['previouspage'] = $_POST['previouspage'];
281
+ $this->options['nextpage'] = $_POST['nextpage'];
282
+ $this->options['before'] = $_POST['before'];
283
+ $this->options['after'] = $_POST['after'];
284
+ $this->options['empty'] = (isset($_POST['empty']) && $_POST['empty'] === 'on') ? true : false;
285
+ $this->options['css'] = (isset($_POST['css']) && $_POST['css'] === 'on') ? true : false;
286
+ $this->options['range'] = intval($_POST['range']);
287
+ $this->options['anchor'] = intval($_POST['anchor']);
288
+ $this->options['gap'] = intval($_POST['gap']);
289
+
290
+ $this->save_admin_options();
291
+
292
+ echo '<div class="updated"><p>' . __('Success! Your changes were successfully saved!', $this->localizationDomain) . '</p></div>';
293
+ }
294
+ else {
295
+ echo '<div class="error"><p>' . __('Whoops! There was a problem with the data you posted. Please try again.', $this->localizationDomain) . '</p></div>';
296
+ }
297
+ }
298
  ?>
299
 
300
  <div class="wrap">
302
  <h2>WP-Paginate</h2>
303
  <form method="post" id="wp_paginate_options">
304
  <?php wp_nonce_field('wp-paginate-update-options'); ?>
305
+ <table class="form-table">
306
+ <tr valign="top">
307
+ <th scope="row"><?php _e('Pagination Label:', $this->localizationDomain); ?></th>
308
+ <td><input name="title" type="text" id="title" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['title'])); ?>"/>
309
+ <span class="description"><?php _e('The text/HTML to display before the list of pages.', $this->localizationDomain); ?></span></td>
310
+ </tr>
311
+ <tr valign="top">
312
+ <th scope="row"><?php _e('Previous Page:', $this->localizationDomain); ?></th>
313
+ <td><input name="previouspage" type="text" id="previouspage" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['previouspage'])); ?>"/>
314
+ <span class="description"><?php _e('The text/HTML to display for the previous page link.', $this->localizationDomain); ?></span></td>
315
+ </tr>
316
+ <tr valign="top">
317
+ <th scope="row"><?php _e('Next Page:', $this->localizationDomain); ?></th>
318
+ <td><input name="nextpage" type="text" id="nextpage" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['nextpage'])); ?>"/>
319
+ <span class="description"><?php _e('The text/HTML to display for the next page link.', $this->localizationDomain); ?></span></td>
320
+ </tr>
321
+ </table>
322
+ <p>&nbsp;</p>
323
+ <h3><?php _e('Advanced Settings', $this->localizationDomain); ?></h3>
324
+ <table class="form-table">
325
+ <tr valign="top">
326
+ <th scope="row"><?php _e('Before Markup:', $this->localizationDomain); ?></th>
327
+ <td><input name="before" type="text" id="before" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['before'])); ?>"/>
328
+ <span class="description"><?php _e('The HTML markup to display before the pagination code.', $this->localizationDomain); ?></span></td>
329
+ </tr>
330
+ <tr valign="top">
331
+ <th scope="row"><?php _e('After Markup:', $this->localizationDomain); ?></th>
332
+ <td><input name="after" type="text" id="after" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['after'])); ?>"/>
333
+ <span class="description"><?php _e('The HTML markup to display after the pagination code.', $this->localizationDomain); ?></span></td>
334
+ </tr>
335
+ <tr valign="top">
336
+ <th scope="row"><?php _e('Markup Display:', $this->localizationDomain); ?></th>
337
+ <td><label for="empty">
338
+ <input type="checkbox" id="empty" name="empty" <?php echo ($this->options['empty'] === true) ? "checked='checked'" : ""; ?>/> <?php _e('Show Before Markup and After Markup, even if the page list is empty?', $this->localizationDomain); ?></label></td>
339
+ </tr>
340
+ <tr valign="top">
341
+ <th scope="row"><?php _e('WP-Paginate CSS File:', $this->localizationDomain); ?></th>
342
+ <td><label for="css">
343
+ <input type="checkbox" id="css" name="css" <?php echo ($this->options['css'] === true) ? "checked='checked'" : ""; ?>/> <?php printf(__('Include the default stylesheet wp-paginate.css? WP-Paginate will first look for <code>wp-paginate.css</code> in your theme directory (<code>themes/%s</code>).', $this->localizationDomain), get_template()); ?></label></td>
344
+ </tr>
345
+ <tr valign="top">
346
+ <th scope="row"><?php _e('Page Range:', $this->localizationDomain); ?></th>
347
+ <td>
348
+ <select name="range" id="range">
349
+ <?php for ($i=1; $i<=10; $i++) : ?>
350
+ <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['range']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>
351
+ <?php endfor; ?>
352
+ </select>
353
+ <span class="description"><?php _e('The number of page links to show before and after the current page. Recommended value: 3', $this->localizationDomain); ?></span></td>
354
+ </tr>
355
+ <tr valign="top">
356
+ <th scope="row"><?php _e('Page Anchors:', $this->localizationDomain); ?></th>
357
+ <td>
358
+ <select name="anchor" id="anchor">
359
+ <?php for ($i=0; $i<=10; $i++) : ?>
360
+ <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['anchor']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>
361
+ <?php endfor; ?>
362
+ </select>
363
+ <span class="description"><?php _e('The number of links to always show at beginning and end of pagination. Recommended value: 1', $this->localizationDomain); ?></span></td>
364
+ </tr>
365
+ <tr valign="top">
366
+ <th scope="row"><?php _e('Page Gap:', $this->localizationDomain); ?></th>
367
+ <td>
368
+ <select name="gap" id="gap">
369
+ <?php for ($i=1; $i<=10; $i++) : ?>
370
+ <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['gap']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>
371
+ <?php endfor; ?>
372
+ </select>
373
+ <span class="description"><?php _e('The minimum number of pages in a gap before an ellipsis (...) is added. Recommended value: 3', $this->localizationDomain); ?></span></td>
374
+ </tr>
375
+ </table>
376
+ <p class="submit">
377
+ <input type="submit" value="Save Changes" name="wp_paginate_save" class="button-primary" />
378
+ </p>
379
  </form>
380
  <h2><?php _e('Need Support?', $this->localizationDomain); ?></h2>
381
  <p><?php printf(__('For questions, issues or feature requests, please post them in the %s and make sure to tag the post with wp-paginate.', $this->localizationDomain), '<a href="https://wordpress.org/support/plugin/wp-paginate">WordPress Forum</a>'); ?></p>
382
  <h2><?php _e('Want To Contribute?', $this->localizationDomain); ?></h2>
383
  <p><?php _e('If you would like to contribute, the following is a list of ways you can help:', $this->localizationDomain); ?></p>
384
  <ul>
385
+ <li>&raquo; <?php _e('Translate WP-Paginate into your language', $this->localizationDomain); ?></li>
386
+ <li>&raquo; <?php _e('Blog about or link to WP-Paginate so others can find out about it', $this->localizationDomain); ?></li>
387
+ <li>&raquo; <?php _e('Report issues, provide feedback, request features, etc.', $this->localizationDomain); ?></li>
388
+ <li>&raquo; <a href="https://wordpress.org/support/view/plugin-reviews/wp-paginate"><?php _e('Review WP-Paginate on the WordPress Plugins Page', $this->localizationDomain); ?></a></li>
389
  </ul>
390
+ <h2><?php _e('Max Foundry WordPress Plugins', $this->localizationDomain); ?></h2>
391
  <ul>
392
+ <li>&raquo; <a href="https://maxbuttons.com">MaxButtons WordPress Button Plugin</a></li>
393
+ <li>&raquo; <a href="https://maxgalleria.com">MaxGalleria WordPress Gallery Plugin</a></li>
394
+ <li>&raquo; <a href="https://maxgalleria.com/media-library-plus/">Media Library Plus</a>
395
  </ul>
396
  </div>
397
 
398
  <?php
399
+ }
400
+ }
401
  }
402
 
403
  //instantiate the class
404
  if (class_exists('WPPaginate')) {
405
+ $wp_paginate = new WPPaginate();
406
  }
407
 
408
  /**
409
  * Pagination function to use for posts
410
  */
411
  function wp_paginate($args = false) {
412
+ global $wp_paginate;
413
+ $wp_paginate->type = 'posts';
414
+ return $wp_paginate->paginate($args);
415
  }
416
 
417
  /**
418
  * Pagination function to use for post comments
419
  */
420
  function wp_paginate_comments($args = false) {
421
+ global $wp_paginate;
422
+ $wp_paginate->type = 'comments';
423
+ return $wp_paginate->paginate($args);
424
  }
425
 
426
  /*
427
  * The format of this plugin is based on the following plugin template:
428
  * http://pressography.com/plugins/wordpress-plugin-template/
429
+ */