Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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');
    #774273

    Hey 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 Torvik

    #779142

    Hi 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,
    M

    #779515

    Hi,

    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,
    Victoria

    #779848

    Hi,

    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,
    M

    #780466

    Hi 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,
    Victoria

    #781087

    Hi Victoria,

    Works like a charm! Thank you so much!

    Best regards,
    M

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Issue with making an entire column clickable’ is closed to new replies.