
Tagged: clickable post preview, excerpt
-
AuthorPosts
-
July 29, 2025 at 11:53 am #1487337
Dear people on the support forum,
I am creating a website on this domain:
Here, I have 2 sections with post sliders in a 3-column layout. Right now, the featured image, title and read more link are linked to the full article.
Is there a way to make the entire excerpt column clickable?Your help will be highly appreciated!
July 30, 2025 at 7:16 am #1487372Hey pelgrimrat,
Thank you for the inquiry.
You can add this code in the functions.php file to make the excerpt clickable with the same link as the title and featured image.
function ava_custom_script_mod() { ?> <script> // make post grid excerpt clickable jQuery(document).ready(function($) { $('article.slide-entry').each(function() { const $article = $(this); const link = $article.find('a.slide-image').attr('href'); if (link) { const $excerpt = $article.find('.slide-entry-excerpt'); $excerpt.css('cursor', 'pointer').on('click', function(e) { if (!$(e.target).closest('a').length) { window.location.href = link; } }); } }); }); </script> <?php } add_action( 'wp_footer', 'ava_custom_script_mod', 9999 );
Let us know the result.
Best regards,
IsmaelJuly 31, 2025 at 12:14 pm #1487415Hello Ismael,
Thanks for your reply and code!
I have added this code and it works on the excerpt p text, so that’s nice.But my wish is the make the entire area clickable. By this I mean the entire column with the post preview, including the background.
So is CSS that would be the “.avia-content-slider article.slide-entry” area.
Is this also possible?
August 1, 2025 at 6:08 am #1487444Hi,
Thank you for the update.
We adjusted the script a bit. Please remove the previous modification and replace it with the following code:
function ava_custom_script_mod() { ?> <script> // make post grid excerpt clickable jQuery(document).ready(function($) { $('article.slide-entry').each(function() { const $article = $(this); const link = $article.find('a.slide-image').attr('href'); if (link) { $article.css('cursor', 'pointer').on('click', function(e) { if (!$(e.target).closest('a, button').length) { window.location.href = link; } }); } }); }); </script> <?php } add_action('wp_footer', 'ava_custom_script_mod', 9999);
Best regards,
IsmaelAugust 12, 2025 at 11:14 am #1487889Hi Ismael,
Thank you for the updated script. It works fine!
Please mark this topic as resolved.
August 13, 2025 at 10:26 am #1487946Hi,
Great, I’m glad that Ismael could help you out. Please open a new thread if you should have any further questions or problems.
Best regards,
Rikard -
AuthorPosts
- The topic ‘make entire column clickable in post slider’ is closed to new replies.