Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter JakeCr8Guru

    (@jakecr8guru)

    Yeah,

    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.

    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    What 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 theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    Here 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 theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    Got 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 theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    This 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 theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    I cant get the error to go away. Any other suggestions?

    Forum: Hacks
    In reply to: Adding JS to child theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    I 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 theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    I 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 theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    Awesome! perfect.

    Seems to be working good. Thanks for all your help.

    Forum: Hacks
    In reply to: Adding JS to child theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    In 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 theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    Thanks ikaring.

    That makes more sense. I am still getting those errors.

    Uncaught TypeError: $ is not a function
    Uncaught TypeError: jQuery(…).sticky is not a function

    I 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 theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    I 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.

    JakeCr8Guru

    (@jakecr8guru)

    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 theme
    Thread Starter JakeCr8Guru

    (@jakecr8guru)

    I 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.

Viewing 14 replies - 1 through 14 (of 14 total)