Home / Archive / MemberPress: Change the Back-Button Link on Courses
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Change the Back-Button Link on Courses

This code code snippet will replace the URL for the Back-Button link (Arrow link) with a custom link. This link is located in the MemberPress Course Listings page header, and single course page header.

The dummy https://new-link.com URL should be replaced with the URL of the page or post that should be linked instead, on the following link of the code:

navBack.href = 'https://new-link.com';

Code Preview
php
<?php
add_action( 'wp_head', function() { ?>
  <script>
  (function($) {
    document.addEventListener('DOMContentLoaded', function() {
        // Change arrow link
        var navBack = document.querySelector('.nav-back');
        if (navBack) {
            navBack.href = 'https://new-link.com'; // replace the https://new-link.com with a custom URL
        }
       });
  })(jQuery)
  </script>
<?php } );

Comments

Add a Comment