Instead of integrating with the actual paid listing flow, I simply want to display the star icon button for each listing, which links to a custom URL format like: /pricing?{listing_id}
Is there a recommended PHP snippet or filter hook that I can use to append this custom action link without modifying template files?
Yes, everything seems to be correct. Additionally, we recommend that you also use the get_the_ID() function, which will return the listing ID, and you can use it in the href.
Hello, and thank you for these explanations! I have a closely related question - I would like to add custom linked icons to the listing block. By default, there are “Reply to listing” and “Favorite” icons. I have added some attributes for the listings that are displayed in the screenshot attached, but through this method it is only possible to display them as static icons, or as long links with link text (which doesn’t suit me.) I would like the icons to be clickable with a custom link.
Can the same code displayed above in this discussion be used for my purpose, and if yes, where should I add it? Thanks a lot!
However, I would need to add a different link for each listing (an audio file), the link would be specified in the attribute field of each listing. I wonder if it is possible to fetch that link and connect it to the respective attribute icon.
Depending on the developers schedule, you may occasionally find an official Customisation service offered by HivePress themselves, but sadly, it’s currently unavailable at the moment.
I was just thinking that since there are “Reply to listing” and “Favorite” functions for each individual listing, perhaps, there would be a simple way to add another such function with a custom link (not through attributes, but somewhere else).
I was able to find a solution to what I wanted, by adding this in the Format (Optional) section of the Display Settings under the attribute:
<a href="%value%">%icon%</a>
In my case, the attribute Field type is Attachment, file type is .mpeg and in the respective listing field I have added audio file link. Now everything works! The icon links to the respective audio.