Posts by LovelessDesign

145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

Even if I just type

$(window).load(function () {
    alert("s");
}

in my functions.js it’s not loaded.

BUT it works when deregistering and registering jquery.

145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

Because it’s not needed in the dashboard. Many themes use this. But even if I remove it, it doesn’t work ;)

145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

I’ve included my scripts like so:

function lld_enqueue_scripts() {
    if(!is_admin()) {

        wp_register_script('CssBrowserSelector', get_template_directory_uri() . '/js/css_browser_selector.js', array('jquery'), '1', FALSE ); 
        wp_register_script('superfish', get_template_directory_uri() . '/js/superfish.js', array('jquery'), '1', FALSE ); 
        ...
        wp_register_script('functionsJS', get_template_directory_uri() . '/js/functions.js', array('jquery'), '1.0', TRUE );

        wp_enqueue_script('jquery');
        wp_enqueue_script('CssBrowserSelector');
        wp_enqueue_script('superfish');
        ...
        wp_enqueue_script('functionsJS');    
    }
}  
add_action('wp_enqueue_scripts', 'lld_enqueue_scripts');      

Is there anything missing? I removed the deregistering and registering of jquery and jquery doesn’t work anymore.

145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

What do you mean by “Just mention it in the array of scripts required for your script file” Could you give some example code please

I have removed every code that deregisters and registers jQuery

145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

Hm I can’t get jquery to work without deregistering + registering it.

I tried building in the following code before wp_head();. Also tried it in functions.php
<?php wp_enqueue_script('jquery'); ?>
145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

thanks a lot. solved my problem

145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

thanks for help.

I already figured out the problem but haven’t solved it yet.

In the theme options the user can set some options for Nivoslider which I give from PHP to Javascript in the footer.php:
echo "<script type=\"text/javascript\"><!--
    var nivoslider_speed = \"".ot_get_option('nivoslider_speed')."\";
    var nivoslider_effect = \"".ot_get_option('nivoslider_effect')."\";
    </script>";   ?>
In my JS file I call this variables
    if ( nivoslider_speed == '' ) { nivoslider_speed=4000; }    
    $('#slider').nivoSlider({ 
        effect: nivoslider_effect,
        pauseOnHover: false,
        controlNav: false,
        pauseTime: nivoslider_speed
    });

But the variables don’t have a value with my mobile browser (I tried it with alert).

Any Ideas how I could fix it? I already had problems with that PHP code in the footer.php before with IE when it was located in the header.php: The whole page was empty. That’s why I put it in the footer

145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

Hello,

I’ve tried my theme with the standard browser of my android mobile phone (I couldn’t check out a name. It’s just called “Browser”) and my whole jquery Code doesn’t work, even my list menu, which I use for mobile devices instead of the navigation bar.

I also tried Dolphin Browser and Boat Browser where it also doesn’t work. But it works with Opera Mobile Browser and Firefox Mobile Browser.

Does anyone have similar experiences?

I load jquery + my jquery file (functions.js) in the functions.php with this code

wp_deregister_script('jquery');
wp_register_script('jquery','http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', '1.7.1', FALSE); 
wp_register_script('functionsJS', get_template_directory_uri() . '/js/functions.js', array('jquery'), '1.0', TRUE );
wp_enqueue_script('jquery');
wp_enqueue_script('functionsJS');
The functions.js starts with
$(window).load(function () {
I also tried things like
jQuery(document).ready(function($){
145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

Thanks a lot

145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

Ok but some themes promote themselves that they are seo-friendly. So if I include metatags, am I allowed to do that

by
by
by
by
by
by