Created
June 1, 2022 07:59
-
-
Save xlawok/afa726f46bee3ddff66875ff8a483c1d to your computer and use it in GitHub Desktop.
Presta - pagination with ajax load - add pagination No to title and h1
This file contains 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
<script type="text/javascript"> | |
{literal} | |
window.setTimeout(function(){ | |
// on click refresh variables | |
var awgeturl=window.location.href; | |
var awgeturl= awgeturl.split('#/page-')[1]; | |
var content = " - strona "+awgeturl; | |
var theh1=document.querySelector('#category h1.aw-category'); | |
var thetitle=document.title; | |
// replace old " - strona XX" string with new | |
var category_a= (theh1.innerHTML).split(' - strona '); | |
category_a[1]=" - strona " + awgeturl; | |
var title_a= thetitle.split(' - strona '); | |
title_a[1]=" - strona " + awgeturl; | |
if(typeof awgeturl!="undefined"&&awgeturl!="1"){ | |
theh1.innerHTML =category_a.join(''); | |
document.title = title_a.join(''); | |
} | |
else{ | |
theh1.innerHTML =category_a[0]; | |
document.title = title_a[0]; | |
} | |
console.log(awgeturl) | |
}, 1000); | |
{/literal} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment