I have a question. I need to force the page 1 value of a page to a specific URL. I could not figure out how to copy the code of the plugin I'm using, so I decided to make a hint so I could put the system into production. I would like, via JQUERY, to change the HREF attribute of a certain "A" tag, if its class is "page smaller" and if the url defined does not have the "page" string. But I'm getting caught up in JS. I tried the following:
$(function(){
if(!$('a[href*="page"]') && $('a').hasclass('page smaller')){
$("a").attr("href", "http://10.31.0.137/wordpress/index.php/ajax-fonte/page/0")
}
});
In summary, I need to force the link pointing to link , point to link
Here is the paging code to illustrate
<div class="wp-pagenavi">
<span class="pages">Página 3 de 44</span>
<a class="previouspostslink" rel="prev" href="http://10.31.0.137/wordpress/index.php/ajax-fonte/page/2/">«</a>
<a class="page smaller" href="http://10.31.0.137/wordpress/index.php/ajax-fonte/">1</a>
<a class="page smaller" href="http://10.31.0.137/wordpress/index.php/ajax-fonte/page/2/">2</a>
<span class="current">3</span>
<a class="page larger" href="http://10.31.0.137/wordpress/index.php/ajax-fonte/page/4/">4</a>
<a class="page larger" href="http://10.31.0.137/wordpress/index.php/ajax-fonte/page/5/">5</a>
<span class="extend">...</span>
<a class="larger page" href="http://10.31.0.137/wordpress/index.php/ajax-fonte/page/10/">10</a>
<a class="larger page" href="http://10.31.0.137/wordpress/index.php/ajax-fonte/page/20/">20</a><a class="larger page" href="http://10.31.0.137/wordpress/index.php/ajax-fonte/page/30/">30</a>
<span class="extend">...</span>
<a class="nextpostslink" rel="next" href="http://10.31.0.137/wordpress/index.php/ajax-fonte/page/4/">»</a>
</div>