GET http://wptest.traineehalland.se/schema-program/script/jquery.js 404 (Not Found) /schema-program/:24
GET http://wptest.traineehalland.se/schema-program/global.js 404 (Not Found)
It seems jQuery isn’t loading, hence the calendar navigation doesn’t work.
It seems you using a relative url to find jQuery / globa.js:
Hence it doesn’t find it on a sub-page. (You seem to be loading jQuery twice too, which can cause problems) – once from WordPress and once using the above.
Thank you for answering. I’ve looked into it and that does seem to be the problem. I tried hardcoding the url so it searches directly for the jquery and global files. It works for the front page but not the sub-page.
What should I do here? Does it matter if the widget is placed in the sidebar? It’s placed there by default after all. If jquery is loaded twice, how do you prevent that?
mmm… still can’t be found – it’s still using a relative url for me.
wp_enqueue_script('jquery')whenever you need it (or in your header if you wanted loaded on every page).
You should also register and enqueue your
global.jsscript via the WordPress API (see Codex for details)
I’ve removed the hardcoding for jquery and I’m using the wp_jquery_script instead. I also added this to register the global file. Still not loading on the sub-page though.
<?php wp_enqueue_script('jquery', $src='http://wptest.traineehalland.se/wp-content/themes/traineehalland/global.js'); ?>
That has stopped the errors. But the bug persists…
I’ve just noticed that you are you using a shortcode on the main page, and a widget on the sub-page. Could you provide the code where you register the widget? It should be a call to
register_sidebar()somewhere in your theme’s
Looking at the calendar a bit closer, I’m almost certain this is the case.
register_sidebar()should be of the form:
register_sidebar(array( 'name' => __( 'Side bar name' ), 'id' => 'sidebar-id', 'description' => __( 'Widget area description' ), 'before_title' => '<h1>', 'after_title' => '</h1>', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', ));
before_widgetargument – these are necessary for the calendar to function correctly. It seems you are missing the
Thanks again for answering. I have a new problem now that maybe you could help me with. I just installed WordPress on the www-adress, the link I posted above is my subdomain. I uploaded my theme with the same files, but the widget isn’t showing at all in the sidebar. Instead it lists my recent posts.
I have tried replacing codes in sidebar.php, functions.php and archive-event.php, but I can’t get the sidebar to show the widget. What am I doing wrong here?
Update: I just solved it. I had to add it to the sidebar under widgets in the admin panel. Now I’m back where I started this thread, I can’t browse the calendar.
Have you tried the code above – looking at the links above, it still doesn’t appear to be using
'<div id="%1$s" class="widget %2$s">'for the
Hi Stephen! I finally got it to work! It was indeed that code that was missing, thanks for helping me out!
New question though; when I click a date in a month, the page loads and resets the calendar to the current month, which in this case is september. Say I click a date in april 2013, then I want the calendar to stay in april when the page reloads, and not reset to september 2012. Is that possible?
This has been request before, I think in the next update I will change it so it does this…
Hi Stephen. Sorry for re-opening this. I’m having the same issue with the prev & next month links.
The functions.php file has the code you mentioned above with the register-sidebars function, so I wondered if you’ve got any ideas why i’m having the problem?
I’m getting this message in the console;
‘Uncaught TypeError: Object [object Object] has no method ‘off’ ‘
Love the plugin by the way, I just need to sort out this small issue.
The site is using an out of date jQuery (1.6.4) – the plug-in requires 1.7+, since I think 1.9 will be included in WP 3.6 and that removes some functions (and their replacement was added in 1.7).
It seems a plug-in/theme is replacing the WordPress shipped version (which is kept relatively up to date) with Google hosted jQuery.
Chuffed to see a New Frontiers church using my plug-in :).
Thanks for the reply. Yeah, we have a few churches that your plugin is perfect for.
This is a theme that i’ve built from a blank one. Is it possible to overide the out of date jQuery version in the theme’s header.php? (I think a plugin is causing the problem).
You’ll need to find which plug-in is doing it, and then prevent it (you can do this without editing the plug-in). I would also contact the plug-in author and ask them to fix this. Plug-ins should not be doing that, unless you’re using a plug-in whose explicit purpose is to replace the shipped jQuery with the Google hosted one.
If you have any ‘performance’ related plug-ins they might be responsible.
To find the plug-in do a grep search for ‘http://ajax.googleapis.com/ajax/libs/jquery/’ – that should hopefully identify it.
If the plug-in is hosted here on the repo then let me know – since plugins are moderated and they’ll want this fixed. If its hosted elsewhere then you’ll have to ask them to fix it / use another plug-in.
Alternatively you could just use an old stable version of EO (1.8.4 might be ok) that doesn’t require jQuery 1.7+.
Thanks Stephen. I found the plugin causing the issue.
At the moment I edited the plugin (not ideal). Is there a way to prevent it rather than editing it?
- The topic ‘Event Organiser – Next and Prev Month Links not working in Sidebar’ is closed to new replies.