Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • in reply to: Scroll to Top Script #14977
     jdtoppin
    Participant

    Well, I had tried this previously to no avail:

    COPY CODE
    function wpb_adding_scripts() {
    wp_register_script('DarkTip', get_stylesheet_directory_uri() . '/darktip/DarkTip.js');
    wp_register_script('qtip_js', get_stylesheet_directory_uri() . '/darktip/ext/qtip2/jquery.qtip.min.js');
    wp_register_script('wow', get_stylesheet_directory_uri() . '/darktip/modules/wow.js');
    wp_register_script('wow_realm', get_stylesheet_directory_uri() . '/darktip/modules/wow.realm.js');
    wp_register_script('wow_quest', get_stylesheet_directory_uri() . '/darktip/modules/wow.quest.js');
    wp_register_script('wow_item', get_stylesheet_directory_uri() . '/darktip/modules/wow.item.js');
    wp_register_script('wow_item_equipped', get_stylesheet_directory_uri() . '/darktip/modules/wow.item.equipped.js');
    wp_register_script('wow_character', get_stylesheet_directory_uri() . '/darktip/modules/wow.character.js');
    wp_register_script('wow_character_spec', get_stylesheet_directory_uri() . '/darktip/modules/wow.character.spec.js');
    wp_register_script('wow_character_pvp', get_stylesheet_directory_uri() . '/darktip/modules/wow.character.pvp.js');
    wp_register_script('wow_guild', get_stylesheet_directory_uri() . '/darktip/modules/wow.guild.js');
    wp_register_script('wow_arena', get_stylesheet_directory_uri() . '/darktip/modules/wow.arena.js');
    wp_register_script('wow_achievement', get_stylesheet_directory_uri() . '/darktip/modules/wow.achievement.js');
    wp_register_script('wow_spell', get_stylesheet_directory_uri() . '/darktip/modules/wow.spell.js');
    wp_register_script('wow_wowhead', get_stylesheet_directory_uri() . '/darktip/modules/wow.wowhead.js');
    wp_register_script('wow_wowhead_character', get_stylesheet_directory_uri() . '/darktip/modules/wow.wowhead.character.js');
    wp_register_script('wow_wowhead_guild', get_stylesheet_directory_uri() . '/darktip/modules/wow.wowhead.guild.js');
    wp_register_script('wow_wowhead_item', get_stylesheet_directory_uri() . '/darktip/modules/wow.wowhead.item.js');
    wp_register_script('wow_wowhead_achievement', get_stylesheet_directory_uri() . '/darktip/modules/wow.wowhead.achievement.js');
    wp_register_script('wow_wowhead_quest', get_stylesheet_directory_uri() . '/darktip/modules/wow.wowhead.quest.js');
    wp_register_script('wow_wowhead_spell', get_stylesheet_directory_uri() . '/darktip/modules/wow.wowhead.spell.js');
    wp_register_script('d3', get_stylesheet_directory_uri() . '/darktip/modules/d3.js');
    wp_register_script('d3_profile', get_stylesheet_directory_uri() . '/darktip/modules/d3.profile.js');
    wp_enqueue_script('DarkTip');
    wp_enqueue_script('qtip_js');
    wp_enqueue_script('wow');
    wp_enqueue_script('wow_realm');
    wp_enqueue_script('wow_quest');
    wp_enqueue_script('wow_item');
    wp_enqueue_script('wow_item_equipped');
    wp_enqueue_script('wow_character');
    wp_enqueue_script('wow_character_spec');
    wp_enqueue_script('wow_character_pvp');
    wp_enqueue_script('wow_guild');
    wp_enqueue_script('wow_arena');
    wp_enqueue_script('wow_achievement');
    wp_enqueue_script('wow_spell');
    wp_enqueue_script('wow_wowhead');
    wp_enqueue_script('wow_wowhead_character');
    wp_enqueue_script('wow_wowhead_guild');
    wp_enqueue_script('wow_wowhead_item');
    wp_enqueue_script('wow_wowhead_achievement');
    wp_enqueue_script('wow_wowhead_quest');
    wp_enqueue_script('wow_wowhead_spell');
    wp_enqueue_script('d3');
    wp_enqueue_script('d3_profile');
    }
    
    add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );  
    
    function wpb_adding_styles() {
    wp_register_style('qtip_style',get_stylesheet_directory_uri().'/darktip/ext/qtip2/jquery.qtip.min.css');
    wp_register_style('wow_style',get_stylesheet_directory_uri().'/darktip/modules/wow.css');
    wp_register_style('d3_style',get_stylesheet_directory_uri().'/darktip/modules/d3.css');
    wp_enqueue_style('qtip_style');
    wp_enqueue_style('wow_style');
    wp_enqueue_style('d3_style');
    }
    
    add_action( 'wp_enqueue_scripts', 'wpb_adding_styles' ); 
    

    I think it is the

    COPY CODE
    
    <script type="text/javascript">
    
      window.___DarkTipSettings = {
    

    Window part that I can’t figure out. Script author told me the script comes with its own async script/style loader… which is why I shortened it up to just the DarkTip script.

    I mean, it works direct in the footer, just not with the enqueue, although I think I had it working once, but it was breaking the scroll to top.

    in reply to: Scroll to Top Script #14964
     jdtoppin
    Participant

    Yeah, I’ve tried that sadly. 🙁

    Check it out now with it enqueue’d in the footer.

    Doesn’t work… it should load dependencies, but it does not and breaks the scroll to top.

    COPY CODE
    function wpb_adding_scripts() {
    wp_register_script('DarkTip', get_stylesheet_directory_uri() . '/darktip/DarkTip.js', '','1.1.5', true);
    
    wp_enqueue_script('DarkTip');
    }
    
    add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );

    That is the code in my child theme function file that breaks it.

    When I load in footer, I use:

    COPY CODE
    <script type="text/javascript">
    
      window.___DarkTipSettings = {
    
        'resources': {
    
          'qtip2'  : [
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/ext/qtip2/jquery.qtip.min.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/ext/qtip2/jquery.qtip.min.css'
          ],
    
          'extras': [
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.css',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.realm.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.quest.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.item.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.item.equipped.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.character.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.character.spec.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.character.pvp.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.guild.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.arena.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.achievement.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.spell.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.wowhead.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.wowhead.achievement.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.wowhead.character.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.wowhead.guild.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.wowhead.item.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.wowhead.quest.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/wow.wowhead.spell.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/d3.css',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/d3.js',
            'http://www.someguild.com/wp-content/themes/kleo-child/darktip/modules/d3.profile.js'
          ]
    
        }
    
      };
    
    </script>
    <script type="text/javascript" src="http://www.someguild.com/wp-content/themes/kleo-child/darktip/DarkTip.js"></script>

    So it is loading all the resources with it.

Viewing 2 posts - 1 through 2 (of 2 total)

Log in with your credentials

Forgot your details?