Created
December 19, 2013 14:29
-
-
Save spacedmonkey/8039923 to your computer and use it in GitHub Desktop.
Use wp_link_pages in twitter bootstrap 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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