Tagged: , ,

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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,
    Warren

    #377201

    Hi wcathro!

    please refer to this post: https://kriesi.at/support/topic/linking-the-icon-box-icon/#post-183782

    Regards,
    Andy

    #377624

    Thanks Andy,
    Is there any way to do this in the child theme so it won’t be overwritten at the next main theme update?

    #378292
    #378374

    Thanks 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,
    Warren

    #378377

    Hi!

    You can move your modified avia.js file into your child theme inside js folder

    Regards,
    Yigit

    #777898

    What 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.

    #778043

    For 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; }
    #778323

    Hi,
    Thank you for sharing your solution, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Icon Box – apply link to entire box’ is closed to new replies.