Description
Paginate an array of post IDsGiven an array of post IDs we need to find the first post to display from the passed page ID for this instance and only display posts from start to end then display the pagination stuff
Usage
bw_navi_ids( $posts, $atts );Parameters
- $posts
- ( array ) required – array of post IDs
- $atts
- ( arry ) optional – shortcode parameters
Returns
voidSource
File name: oik/shortcodes/oik-navi.phpLines:
1 to 17 of 17
function bw_navi_ids( $posts, $atts=null ) { $bwscid = bw_get_shortcode_id( true ); $page = bw_check_paged_shortcode( $bwscid ); $posts_per_page = get_option( "posts_per_page" ); $count = count( $posts ); $pages = ceil( $count / $posts_per_page ); $start = ( $page-1 ) * $posts_per_page; $end = min( $start + $posts_per_page, $count ) -1; bw_navi_s2eofn( $start, $end, $count ); oik_require( "shortcodes/oik-list.php" ); $ol = bw_sl( $atts, $start ); for ( $i = $start; $i<= $end; $i++ ) { bw_list_id( $posts[$i] ); } bw_el( $ol ); bw_navi_paginate_links( $bwscid, $page, $pages ); }View on GitHub View on Trac
Called by
Invoked by
Calls
1 to 8 of 8
- bw_check_paged_shortcode() – Return the required page if this is the shortcode we’re processing
- bw_el() – End a list
- bw_get_shortcode_id() – Return the next unique shortcode ID
- bw_list_id() – Display a link to a post in a list item
- bw_navi_paginate_links() – Paginate links for shortcode pagination
- bw_navi_s2eofn() – Display "start to end of count" message
- bw_sl() – Start a list
- oik_require() – Invoke require_once on an oik include file or other file
