Join

Open MyListing Button Links in a New Tab

Don't want to mess with code snippets? Request for this to be a feature of MyListing Pro.

Instructions

  1. Create a new JS code snippet.
  2. Copy the contents of code snippet below.
  3. Paste the contents into your code snippet.
  4. Review any notes that I’ve provided.
  5. Save and enable the code snippet.
  6. Test.

Snippet

This code snippet targets MyListing’s Button 4 style (.button-4), so if you want to target a different button style, be sure to update the snippet accordingly.

JavaScript
jQuery('.button-4').attr('target', '_blank')

If you only want to target buttons in a particular block, the steps below will help.

  1. Custom Block ID > Add a custom ID (e.g., myblockid) to the desired single listing block
  2. Adjust the code snippet as shown below, replacing myblockid with your ID from the previous step
JavaScript
jQuery('#myblockid .button-4').attr('target', '_blank')