Hi @kev36663
Uncaught ReferenceError: jQuery is not defined
An error has occurred because the jquery dependency script is loaded before jquery is called
This is probably not a problem with the Raindrops theme
http://www.rftkpromotions.co.uk/wp-content/cache/minify/5b521.js
and
jQuery(function($) {
$('.date-pick').each(function() {
var format = $(this).data('format') || 'mm/dd/yyyy';
format = format.replace(/yyyy/i, 'yy');
$(this).datepicker({
autoFocusNextInput: true,
constrainInput: false,
changeMonth: true,
changeYear: true,
beforeShow: function(input, inst) { $('#ui-datepicker-div').addClass('show'); },
dateFormat: format.toLowerCase(),
});
});
d = new Date();
$('.birthdate-pick').each(function() {
var format = $(this).data('format') || 'mm/dd';
format = format.replace(/yyyy/i, 'yy');
$(this).datepicker({
autoFocusNextInput: true,
constrainInput: false,
changeMonth: true,
changeYear: false,
minDate: new Date(d.getFullYear(), 1-1, 1),
maxDate: new Date(d.getFullYear(), 12-1, 31),
beforeShow: function(input, inst) { $('#ui-datepicker-div').removeClass('show'); },
dateFormat: format.toLowerCase(),
});
});
});
These two scripts are called before jQuery is invoked.
Analogous to the position of the code, it may be inserted using the_generator filter.
You can place code that depends on jquery in the appropriate place by referring to the following page.
wp_enqueue_script() | Function | WordPress Developer Resources
Thank you.
thank you for this. I should point out my knowledge in coding is limited – I rely heavily on plugins and off-the-shelf settings.
The page seems easy enough to follow – but, for example, in which file(s?) do I place the code?
in which file(s?) do I place the code?
raindrops/functions.php
If you just installed the plug-in and did not write your own code, it is best to contact the plug-in author
Of course, do my best if there is any problem with the theme.
Thank you.
I’ve since tried other/similar plugins and run into the same problem.
There’s something in some update somewhere has knocked it out – but there’s not been new version(s) of the plugin released since I went from working fine to not working fine.
I spoke to the plugin author who suggests it’s wordpress not calling jQuery – although things I was trying from there were not working.
It also affects 3 sites on 2 different hosts so not likely to be a hosting issue.
is it just a copy paste of the below I need to insert into my functions file?
function wp_enqueue_script( $handle, $src = '', $deps = array(), $ver = false, $in_footer = false ) {
$wp_scripts = wp_scripts();
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
if ( $src || $in_footer ) {
$_handle = explode( '?', $handle );
if ( $src ) {
$wp_scripts->add( $_handle[0], $src, $deps, $ver );
}
if ( $in_footer ) {
$wp_scripts->add_data( $_handle[0], 'group', 1 );
}
}
$wp_scripts->enqueue( $handle );
}
and any particular location – I’m struggling to find where the offending functions above are called.
First, let’s see how plugins are inserting scripts into themes.
It is necessary to read the plug-in code and understand the mechanism.
Probably Plug-in do not use wp_enqueue_script (), so remove it,( stop errors )
It is necessary to use wp_enqueue_script () to adjust the script so that it is inserted in the correct position.
by the way
Is it possible to explain how the ugly mobile menu can be changed to become the pretty mobile menu?
-
This reply was modified 5 years, 5 months ago by nobita.
I’m not sure what you mean on the first points.
For a prettier menu.
Something like the hamburger (3 lines) which when clicks causes the menu to slide out – that’s a lot cleaner to use. Some other themese use this as default, otherwise it’s a case of looking for a plugin like Responsive Menu.
On a computer, the raindrops menu looks fab, but the “+ menu -” isn’t so great.
OK
next update maybe change from “+ menu -” to humberger menu.
Thank you.
that would solve my problem for sure π
raindrops 1.526 is now live
Please check humberger menu.
Thank you
it’s a little worse
it’s still got + and-
but now isn’t marked as menu
cache?
please see below
https://www.tenman.info/wp3/previewraindrops/
Note:update has mistake CSS
PC view primary menu show scroll bar
Please add below style
@media screen and (min-width : 641px){
/* @1.527 */
#doc3 #access,
#doc5 #access {
overflow-y:hidden;
}
}
yep – tried to clear cache and use other devices
I’ve had a look on your preview version – and the preview looks fine on web, but doesn’t really work on mobile devices.
Hello,
Just a little update
Your new menu now works on one of my websites – lockdownrockclub.co.uk – and it looks great – thank you!
however, on another – rftkpromotions.co.uk – it still looks messy… is there anything I need to do to correct this?