Free Directory, Listing & Classifieds WordPress Plugin Support General HivePress Make links in Listings open in a new tab / window

Make links in Listings open in a new tab / window

  • Author
    Posts
  • martin

    Hi!

    Is there a way to make the URL / links in the Listings open in a new tab? Right now it opens in the same window and takes my visitors away from my site.

    Thanks!

    BR,
    Martin

    ihordeveloper

    Hi,

    If you mean all links in the listing description, it’s possible but requires some customizations. If you’re familiar with PHP you can start with overriding the listing description template part https://github.com/hivepress/hivepress/blob/master/templates/listing/view/page/listing-description.php

    yasutosi.urasaki@gmail.com

    Hi Martin.
    I have solved this issue putting a decorator on atribute display format.
    sample:
    I have used web linked fields as text field, them use formar as (for url field)
    <a href="http://%value%" target="_blank" rel="noopener noreferrer"><img src="./wp-content/uploads/2020/06/web-ico.png" width="32px" /> %value%</a>
    On this case I apllied a blank window link and an image (i have uploaded do WordPress).
    On WhatsApp field:
    <a href="https://wa.me/55%value%/?text=Ol%C3%A1+vi+o+seu+anuncio+no+MarketPlace+Vida+e+queria+...%0D%0A" target="_blank" rel="noopener noreferrer"><img src="./wp-content/uploads/2020/06/whatsapp-ico.png" width="32px" /> %value%</a>
    You can see the result on my listing site:
    https://market.vidanova.org.br/
    All web links open a new window.

    Walther

    #yasutosi.urasaki@gmail.com
    but where do I put all this?

    ihordeveloper

    You can add these codes to the attribute display format, but this will open links in a new tab for the attributes only, links in the listing description will still open in the same tab.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Subscribe

Sign In

Don't have an account? Register

Forgot password?

Register

Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.