(Squarespace) Add a Back button between Video Pagination

To add a Back button between Video Pagination.

#1. First, find Video Page URL.

In my example, it is: /videos-1

image

#2 . Next, open Video Page > Click Gear icon

Click Advanced > Page Header Code Injection

Paste this code into right box.
If code doesn’t work, you can comment below, message or send me an email.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
  $('<a>', {
    class: 'btn btn--border theme-btn--primary-inverse sqs-button-element--primary back-all-video',
    href: '/videos-1',
    text: 'Back to All'
  })
  .css('margin', '0 15px')
  .appendTo('section.lesson-item-pagination.lesson-item-pagination--prev-next');
});
</script>

#3. Use this code to Custom CSS box

/* Video Back to */
section.lesson-item-pagination.lesson-item-pagination--prev-next {
position: relative;
}
a.back-all-video {
position: absolute;
left: 50%;
transform: translateX(-50%);
margin: unset !important;
}
@media screen and (max-width:767px) {
h2.lesson-item-pagination-title {
font-size: 15px !important;
}
a.back-all-video {
padding: 5px 10px !important;
}}

#4. Result

#5. You can change Button Text, Button URL here

And change button size on Mobile here

1 Like