-
AuthorPosts
-
January 8, 2015 at 8:09 pm #377064
Hi,
I would like to apply a link to an entire icon box, much the same way as a full width button, rather than just the icon or title.
Can you please show me how to do this?Thanks,
WarrenJanuary 9, 2015 at 5:15 am #377201Hi wcathro!
please refer to this post: https://kriesi.at/support/topic/linking-the-icon-box-icon/#post-183782
Regards,
AndyJanuary 9, 2015 at 10:29 pm #377624Thanks Andy,
Is there any way to do this in the child theme so it won’t be overwritten at the next main theme update?January 12, 2015 at 3:38 pm #378292Hey!
Please refer to my post here – https://kriesi.at/support/topic/pre-built-enfold-child-does-not-call-wp_enqueue_script/#post-373606
Regards,
YigitJanuary 12, 2015 at 5:14 pm #378374Thanks Yigit. So if I insert the following code into the functions.php file:
function wp_change_aviajs() { wp_dequeue_script( 'avia-default' ); wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true ); } add_action( 'wp_print_scripts', 'wp_change_aviajs', 100 );
Then where would I copy this code into?
jQuery(".home article.iconbox").each(function(){ var theLink = jQuery(this).find("a").attr("href"); jQuery(this).on("click", function(){ window.location.href = theLink; }); });
Thanks,
WarrenJanuary 12, 2015 at 5:18 pm #378377Hi!
You can move your modified avia.js file into your child theme inside js folder
Regards,
YigitApril 14, 2017 at 5:24 pm #777898What exactly needs to happen to get this to link the entire icon box?
I put this code in my child theme’s functions.php file:
function wp_change_aviajs() { wp_dequeue_script( 'avia-default' ); wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true ); } add_action( 'wp_print_scripts', 'wp_change_aviajs', 100 );
I have pasted this to the end of avia.js:
jQuery(".home article.iconbox").each(function(){ var theLink = jQuery(this).find("a").attr("href"); jQuery(this).on("click", function(){ window.location.href = theLink; }); });
I have moved that modified avia.js file to a new folder ‘js’ and placed it within the enfold child theme directory.
April 14, 2017 at 8:09 pm #778043For anyone who is trying to do this, the above code works as intended but you also need to add this into your quick css field:
.home article.iconbox{ cursor: pointer; }
April 16, 2017 at 1:25 am #778323 -
AuthorPosts
- The topic ‘Icon Box – apply link to entire box’ is closed to new replies.