JakeCr8Guru
Forum Replies Created
-
Forum: Plugins
In reply to: mod_security and Login with Ajax pluginYeah,
So when I use Login with Ajax I type my username and password in then it gives me an error of: An error has occured. Please try again.
And in the console: Failed to load resource: the server responded with a status of 406 (Not Acceptable)I have no experience with security mods. If I would have to change anything I am not sure where to start.
Forum: Plugins
In reply to: mod_security and Login with Ajax pluginWhat do I need to be looking for to find that out?
It gave me a 406 error in the console.
Forum: Hacks
In reply to: Adding JS to child themeHere is the errors: Uncaught TypeError: Cannot read property ‘top’ of undefined
Then when I scroll the number grows.
Other transitions and effects don’t work at this time also.
To stop this I add a div with a class of “navbar” to the header fixed nav area.
I will not keep it like this all the time. I do not want my website like that all the time.
Forum: Hacks
In reply to: Adding JS to child themeGot this code to work:
(function($){ //jQuery to collapse the navbar on scroll $(window).scroll(function() { if ($(".navbar").offset().top > 50) { $(".navbar-fixed-top").addClass("top-nav-collapse"); } else { $(".navbar-fixed-top").removeClass("top-nav-collapse"); } }); //jQuery for page scrolling feature - requires jQuery Easing plugin $(function() { $('a.page-scroll').bind('click', function(event) { var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1500, 'easeInOutExpo'); event.preventDefault(); }); }); })(jQuery);
But now it is giving me lots of errors!
Forum: Hacks
In reply to: Adding JS to child themeThis seems weird to me. My website is still doing what it kind of should be, but my server is not saving the files I edited. My functions.php is blank. I keep trying to change scrolling-nav.js but no luck.
I think if I can get that to save with the added code you suggested:
(function($){ //paste original code here })(jQuery);
it should work.
Forum: Hacks
In reply to: Adding JS to child themeI cant get the error to go away. Any other suggestions?
Forum: Hacks
In reply to: Adding JS to child themeI also added that to the scrolling-nav.js
(function($) { //jQuery to collapse the navbar on scroll $(window).scroll(function() { if ($(".navbar").offset().top > 50) { $(".navbar-fixed-top").addClass("top-nav-collapse"); } else { $(".navbar-fixed-top").removeClass("top-nav-collapse"); } }); //jQuery for page scrolling feature - requires jQuery Easing plugin $(function() { $('a.page-scroll').bind('click', function(event) { var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1500, 'easeInOutExpo'); event.preventDefault(); }); }); })(jQuery);
still have error.
Forum: Hacks
In reply to: Adding JS to child themeI see what you mean.
I added that to my code but it does not fix the issue.
<!-- Script for scrollNav.js --> <script> (function($){ jQuery(document).ready(function($){ $('.main-nav .menu li a').addClass('page-scroll'); }); })(jQuery); </script>
And I have the menu items jumping to where they need to but the easing script is not working.
I have tried switching $ and jquery back and forth but no success.
Forum: Hacks
In reply to: Adding JS to child themeAwesome! perfect.
Seems to be working good. Thanks for all your help.
Forum: Hacks
In reply to: Adding JS to child themeIn my footer.php file it does have the
<?php wp_footer(); ?>
i just didn’t copy that.Unless you mean I need some thing in my functions.php. I tired that and I am pretty sure that is not right.
Do I need the code for the script to be in my functions also or is the footer the right place?
Forum: Hacks
In reply to: Adding JS to child themeThanks ikaring.
That makes more sense. I am still getting those errors.
Uncaught TypeError: $ is not a function
Uncaught TypeError: jQuery(…).sticky is not a functionI have in my function.php file:
<?php function my_scripts_method() { wp_enqueue_script( 'sticky-menu', get_stylesheet_directory_uri() . '/js/jquery.sticky.js', array( 'jquery' ), true ); wp_enqueue_script( 'scrolling-menu', get_stylesheet_directory_uri() . '/js/scrolling-nav.js', array( 'jquery' ), true ); wp_enqueue_script( 'easinging-menu', get_stylesheet_directory_uri() . '/js/jquery.easing.min.js', array( 'jquery' ), true); } add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); ?>
then in my footer.php:
<!-- Script for sticky.js --> <script> jQuery(document).ready(function(){ jQuery("#main-menu-container").sticky({topSpacing:0}); }); </script> <!-- Script for scrollNav.js --> <script> jQuery(document).ready(function(){ jQuery('.main-nav li a').addClass('page-scroll'); }); </script> </body> </html>
Everything is up to date and my server should be fine. Has no one else ever tired to do this before? Could the theme be the problem? These are just things I am wondering.
Forum: Hacks
In reply to: Adding JS to child themeI tried that and this is what I got:
<?php function my_scripts_method() { wp_enqueue_script( 'sticky-menu', get_stylesheet_directory_uri() . '/js/jquery.sticky.js', array( 'jquery' ), true ); } add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); ?> <?php function my_scripts_method() { wp_enqueue_script( 'scrolling-menu', get_stylesheet_directory_uri() . '/js/scrolling-nav.js', array( 'jquery' ), true ); } add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); ?> <?php function my_scripts_method() { wp_enqueue_script( 'easinging-menu', get_stylesheet_directory_uri() . '/js/jquery.easing.min.js', array( 'jquery' ), true); } add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); ?> <!-- Script for sticky.js --> <script> jQuery(document).ready(function(){ jQuery("#main-menu-container").sticky({topSpacing:20}); }); </script> <!-- Script for scrollNav.js --> <script> jQuery(document).ready(function(){ jQuery('.main-nav li a').addClass('page-scroll'); }); </script>
I know it is not correct but I need to know what to do for this specific thing. I have three plugins. I think two for sure use jQuery.
I am having a similar issue. Would you be willing to take a look at my forum topic?
Forum: Hacks
In reply to: Adding JS to child themeI don’t think enqueuing is the problem.
I have done that before and still got the errors. I understand that is a better practice but I am still getting the js called so that shouldn’t be the problem.