simen
June 10, 2024, 6:13pm
1
I have tried to add a “Read More” button on the listings page, that shall redirect to the listing, but i cant get it to work. Anyone who can help me with this?
Thank you
add_action('wp_footer', function() {
?>
<script>
jQuery(document).ready(function($) {
$('.hp-listing').each(function() {
var listingUrl = $(this).find('.hp-listing-title a').attr('href');
$(this).append('<a href="' + listingUrl + '" class="button">Read more</a>');
});
});
</script>
<?php
});
andrii
June 11, 2024, 12:30pm
5
Hi,
Unfortunately, we cannot help with a specific code, as it is beyond our scope. If you’re familiar with coding, there are two ways to go about it:
Use the template hook on the listing view block and customize it, please check these samples: Search · user:hivepress template · GitHub
Or overwrite template parts using child theme: How to override template parts - HivePress Help Center
I hope this is helpful to you.
system
Closed
July 11, 2024, 12:31pm
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.