Jump to content

Change Next/Previous navigation on Rally blog navigation

Go to solution Solved by markvigeant,

Recommended Posts

  • Solution

Hey there-

I just solved a similar issue on a blog on the Margot template. Here's the code I used, with the appropriate class names taken from Rally. Toss this into your header and let me know if you need anything else!

<script>
(function() {
    window.addEventListener('load', function() {
        var paginationLabels = document.querySelectorAll('.BlogItem-pagination-link-label');

        for (var i = 0; i < paginationLabels.length; i++) {
            var text = paginationLabels[i].textContent;

            text = text.replace("Previous", "Newer Post");
            text = text.replace("Next", "Older Post");

            paginationLabels[i].textContent = text;
        }
    });
})();
</script>

 

Link to comment
  • 2 years later...
13 hours ago, martinp said:

I have the same issue but This code didn't work for me. The url is https://www.jeuno.fr/blog

Try this

<script>
  (function() {
    window.addEventListener('load', function() {
        var paginationLabels = document.querySelectorAll('nav.blog-list-pagination span');

        for (var i = 0; i < paginationLabels.length; i++) {
            var text = paginationLabels[i].textContent;

            text = text.replace("Billets plus récents", "Newer Post");
            text = text.replace("Billets plus anciens", "Older Post");

            paginationLabels[i].textContent = text;
        }
    });
})();
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 weeks later...
On 1/15/2024 at 6:47 AM, tuanphan said:

Try this

<script>
  (function() {
    window.addEventListener('load', function() {
        var paginationLabels = document.querySelectorAll('nav.blog-list-pagination span');

        for (var i = 0; i < paginationLabels.length; i++) {
            var text = paginationLabels[i].textContent;

            text = text.replace("Billets plus récents", "Newer Post");
            text = text.replace("Billets plus anciens", "Older Post");

            paginationLabels[i].textContent = text;
        }
    });
})();
</script>

 

this worked great thanks! is there a way to remove the arrows too? they look relly strange now.

 

Link to comment
On 1/26/2024 at 12:11 AM, martinp said:

this worked great thanks! is there a way to remove the arrows too? they look relly strange now.

 

Add this code under

<style>
  .blog-list-pagination-icon.icon.icon--stroke {
    display: none;
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.