Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #779965

    Hi, we have added a child theme and copied the header.php into the child theme (we needed to add some code to the header.php) but it’s not picking up the revised header.php.

    Please could you check why this isn’t working.

    Thanks

    #780317

    Hey helenwhite,

    What code have you added and what is the purpose of it?

    Best regards,
    Rikard

    #781131

    We are just adding this tooltop https://jqueryui.com/tooltip/. So added some code to the the child header.php.

    We would like to add a tooltip to some of the timetable copy.

    Is that ok? or can you suggest an alternative way of doing this?

    Thanks

    #781145

    Hi!

    Please add following code to Functions.php file of your child theme

    function add_tooltip_js() {
        wp_enqueue_script( 'tooltip-js', get_template_directory_uri() . '/js/tooltip.js', array(), '1.0.0', true );
    }
    add_action( 'wp_enqueue_scripts', 'add_tooltip_js' );

    then place tooltip.js file inside /js folder on your child theme. You do not need to copy header.php file to your child theme to enqueue that script :)

    Best regards,
    Yigit

    #781172

    Where do we get the tooltip.js file from?

    #781431

    Hi,

    Since it’s from jquery ui, I don’t think it’s necessary to add an extra js file, try to replace this part of the code Yigit gave:

    wp_enqueue_script( 'tooltip-js', get_template_directory_uri() . '/js/tooltip.js', array(), '1.0.0', true );

    to

    wp_enqueue_script( 'jquery-ui-tooltip' );

    Hope this helps.

    Best regards,
    Nikko

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.