Add Navigation from the WP-PageNavi Plugin

From IThemes Codex
Jump to: navigation, search

LoopBuddy includes support for the wp_pagenavi plugin. Loopbuddy will insert the navigation at the bottom of the page, if you have installed and activated the plugin, and if you have ticked "Enable Paging" in the Query editor. However, if you want more control over when and where the wp_pagenavi navigation will appear, you can do so using a shortcode. Note that if you want to use a shortcode to insert the navigation, you should untick the "Enable Paging" setting, otherwise, it will show up twice. Add the following code at the end of your functions.php file (but before the closing ?>, if any).

Code

function my_insert_pagenavi() {
    return wp_pagenavi();
}
add_shortcode('insert-page-navi', 'my_insert_pagenavi');

Usage

Insert the shortcode [insert-page-navi] in your LoopBuddy layout where you want the wp-pagenavi pagination to appear. Generally, this would be in either (or both) the "Pre-Loop Text / HTML" or the "Post-Loop Text / HTML", since we usually don't want the pagination to appear in every post in a list of posts.


← Back to LoopBuddy Codex Home

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox