I have the wordpress website that use the pagination and I'm also use the plugin Pagenavi for pagination but I can not use it as my language number so I need to customize code by using jquery and javascript. I have the code as below :
<div class="wp-pagenavi">
<span class="pages">ទំព័រ 1 នៃទំព័រ 4</span>
<span class="current">1</span>
<a class="page larger" href="http://192.168.1.136:85/pic/publications/research-documents/page/2/">2</a>
<a class="page larger" href="http://192.168.1.136:85/pic/publications/research-documents/page/3/">3</a>
<a class="page larger" href="http://192.168.1.136:85/pic/publications/research-documents/page/4/">4</a>
<a class="nextpostslink" href="http://192.168.1.136:85/pic/publications/research-documents/page/2/">»</a>
I want to change the number of 1,2,3,4,....in <a> value to the khmer number such as ១,២,៣, ៤... I have try some code but it is not success as below:
var getPagination = $("div.wp-pagenavi a.larger").length;
var findcurrent = $("div.wp-pagenavi span.current").text();
var page = '';
for(i =1;i<= getPagination;i++){
page = $( "div.wp-pagenavi a.larger:nth-of-type("+i+")" ).text();
switch(i){
case 1:
numgl = "១";
break;
case 2:
numgl = "២";
break;
case 3:
numgl = "៣";
break;
case 4:
numgl = "៤";
break;
}
//if it current pagination
$("div.wp-pagenavi span.current").text(numgl);
//for other number of pagination
$( "div.wp-pagenavi a.larger:nth-of-type("+i+")" ).text(function( i) {
return numgl;
});
}
I have tried it but it not work.Anyone know help me please, thanks