Changing the class and HTML structure
-
I used this code for few years but seems to have stopped working.
###################### # Change html pagenavi for transform like bootstrap ###################### //attach our function to the wp_pagenavi filter add_filter( 'wp_pagenavi', 'wd_pagination', 10, 2 ); //customize the PageNavi HTML before it is output function wd_pagination($html) { $out = ''; //wrap a's and span's in li's $out = str_replace("<a","<li><a",$html); $out = str_replace("</a>","</a></li>",$out); $out = str_replace("<span","<li><span",$out); $out = str_replace("</span>","</span></li>",$out); $out = str_replace("<div class='wp-pagenavi'>","",$out); $out = str_replace("</div>","",$out); return '<div class="pagination"> <ul>'.$out.'</ul> </div>'; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Changing the class and HTML structure’ is closed to new replies.