Join

How to Add a Back Button to Your MyListing Website With Elementor

  • Guides reflect how I’m currently using the solution for myself and my clients. 
  • If I don’t cover a specific feature, it implies I’m not using it.
  • If I don’t cover a specific setting, it implies the defaults are acceptable or the options are obvious.

This guide was inspired by building a 404 Page for an upcoming MyListing Starter Site.

It’s very common to see a ‘Back to Home’ button on 404 Pages, and I’ve used them myself, but I wanted a simple solution that allows the button to take the user back to the previous page they were on before they hit the 404 Page.

  1. Add a button to the page.
  2. Customize the button as desired without touching any ‘Link’ settings.
  3. Button > Advanced Tab > CSS ID > Add ‘back-button’ for the ID. (Note: Watch the video tutorial if you get stuck.)
  4. Add an Elementor HTML widget to any location on the page (it will not be visible to users).
  5. Add the code snippet below to the HTML widget.
  6. Save changes.
JavaScript
<script type="text/javascript">

jQuery(document).ready(function() {
    jQuery('#back-button').on('click', function() {
      window.history.go(-1);
      return false;
    });
});

</script> 

Video Tutorial

Youtube video