Use the below code in the page html, enclosed with the script tag.Change the URL as per requirements. Whenever user clicks on the page link it will redirect to the specific label filter page specified in the script. It also handles mobile layouts too.
function getQuerystring(key, default_){ if (default_==null) default_=""; key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); var qs = regex.exec(window.location.href); if(qs == null) return default_; else return qs[1]; } if(getQuerystring('m')) window.location="http://www.YourBlog.com/search/label/DESIREDLABEL/?m=1"; else window.location="http://www.YourBlog.com/search/label/DESIREDLABEL";
This is awesome. Exactly what I wanted. Thanks!
ReplyDeleteGlad to hear that.
ReplyDelete