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
- martin4 months, 1 week ago
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.
Martinihor4 months, 1 week agodeveloper
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.phpcondorito4 months, 1 week ago
A jQuery snippet would also do the trick.
Hope this firstname.lastname@example.org months, 1 week ago
I have solved this issue putting a decorator on atribute display format.
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:
All web links open a new window.Walther4 months ago
but where do I put all this?ihor4 months agodeveloper
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.
You must be logged in to reply to this topic.