Skip to content

Instantly share code, notes, and snippets.

@spacedmonkey
Created December 19, 2013 14:29
Show Gist options
  • Save spacedmonkey/8039923 to your computer and use it in GitHub Desktop.
Save spacedmonkey/8039923 to your computer and use it in GitHub Desktop.
Use wp_link_pages in twitter bootstrap 3
function spacedmonkey_pages($old){
$old['before'] = '<ul class="pagination"><li class="disabled"><span>Pages: </span></li>';
$old['after'] = '</ul>';
$old['link_before'] = '<span class="">';
$old['link_after'] = '</span>';
return $old;
}
add_filter( 'wp_link_pages_args', 'spacedmonkey_pages' );
function spacedmonkey_pages_link($old){
$class = (strpos($old,'<a') !== false) ? '' : 'active';
$new = "<li class='$class'>$old</li>";
return $new;
}
add_filter( 'wp_link_pages_link', 'spacedmonkey_pages_link' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment