WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
Compatibility with a bootstrap theme (1 post)

  1. Swashata Ghosh
    Member
    Posted 9 months ago #

    Hi,

    I am making a bootstrap theme, which you can find here: https://github.com/swashata/ipt-knowledgebase-theme-wp .

    I intend to give inbuilt compatibility with your plugin. For that, I needed to convert the output of the plugin to some HTML compatible with bootstrap. This is the code I am using in my theme and so far it has worked good:

    if ( function_exists( 'wp_pagenavi' ) && ! is_single() ) {
    		$wp_pagenavi = wp_pagenavi( array(
    			'echo' => false,
    		) );
    
    		$wp_pagenavi = str_replace( array(
    			"<div class='wp-pagenavi'>",
    			'</div>',
    			"<span class='pages'>",
    			'</span>',
    			"<span class='current'>",
    			'<a href=',
    			'</a>',
    			"<span class='extend'>",
    			/* translator: Translate it to the output of WP PageNavi for your lang */
    			__( '« First', 'ipt_kb' ),
    			/* translator: Translate it to the output of WP PageNavi for your lang */
    			__( 'Last »', 'ipt_kb' ),
    			'«',
    			'»',
    		), array(
    			'<ul class="pagination">',
    			'</ul>',
    			'<li class="disabled"><span>',
    			'</span></li>',
    			'<li class="active"><span>',
    			'<li><a href=',
    			'</a></li>',
    			'<li class="disabled"><span>',
    			'<i class="glyphicon glyphicon-fast-backward"></i>',
    			'<i class="glyphicon glyphicon-fast-forward"></i>',
    			'<i class="glyphicon glyphicon-backward"></i>',
    			'<i class="glyphicon glyphicon-forward"></i>',
    		), $wp_pagenavi );
    
    		echo $wp_pagenavi;
    		return;
    	}

    Please see this image for the output: http://ipanelthemes.com/kb/files/2013/10/WP-PageNavi.png

    Please let me know if I am doing it wrong or it can be done in a better way.

    http://wordpress.org/plugins/wp-pagenavi/

Reply

You must log in to post.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 9 months ago by Swashata Ghosh
  • This topic is not resolved
  • WordPress version: 3.6.1

Tags

No tags yet.