-
AuthorPosts
-
April 7, 2017 at 12:50 pm #773916
Hi,
A few months ago I inserted below code in the theme’s function.php to make entire columns clickable with the help from this post: https://kriesi.at/support/topic/apply-link-to-column-box/. It worked as it should until the last update (I think). I’ve tried deactivating all the plugins. I’ve also tried to remove any custom code I’ve inserted except the below code. But it doesn’t seem any of that is causing the code to stop working.Can you help with that?
/* * Add link to entire column */ function linkbox_clickable(){ ?> <script> jQuery(".linkbox-clickable").click(function(){ window.location = jQuery(this).find("a:first").attr("href"); return false; }); </script> <?php } add_action('wp_footer', 'add_custom_div');
April 8, 2017 at 5:48 am #774273Hey m9491,
First off, thanks for using the Enfold.
To fix it, just the following custom CSS code at Enfold Theme Options > General Styling > Quick CSS
.linkbox-clickable a { padding: 37px 48px; }
Best regards,
John TorvikApril 18, 2017 at 9:28 am #779142Hi John,
Thank you for the code. I tried inserting the it in Quick CSS. However, the text in the boxes ends up being affected too (see attached image).
Best Regards,
MApril 18, 2017 at 5:56 pm #779515Hi,
This is what I am seeing now http://imgur.com/a/AQEVN
Is this a working solution for you or do you still need any help with this?Best regards,
VictoriaApril 19, 2017 at 9:17 am #779848Hi,
The entire column is still not clickable. I just removed the padding because it didn’t work.
As you see in my first post, I have used the mentioned code to make the entire column clickable. It used to work, but now it doesn’t.Best regards,
MApril 20, 2017 at 11:32 am #780466Hi M,
Here is the Javascript code that can help you trigger the link it that element
add_action('wp_footer', 'ava_new_custom_script'); function ava_new_custom_script(){ ?> <script type="text/javascript"> (function($) { $('.post-entry-13 .linkbox-clickable').click(function(e) { var link = this.querySelector('a'); if (link !== undefined) link.click(); }); $(window).load(function() { a(); }); })(jQuery); </script> <?php }
Put it in your functions.php.
If you need further assistance please let us know.
Best regards,
VictoriaApril 21, 2017 at 10:47 am #781087Hi Victoria,
Works like a charm! Thank you so much!
Best regards,
M -
AuthorPosts
- The topic ‘Issue with making an entire column clickable’ is closed to new replies.