Teddy_c
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: .addClass JS/JQUERYWhen I open firebug in firefox, I cannot see my javascript loading in the console.
Forum: Fixing WordPress
In reply to: .addClass JS/JQUERYI have made the changes, however it still does not work. I have just realized though that jQuery-ui is not loading on my website. jQuery is but not jQuery-ui.
Forum: Fixing WordPress
In reply to: .addClass JS/JQUERYHey Stephen,
the code is kind of long, here is the link to the different sheet:
header.php
style.css
sticky.js
functions.php (parent)
functions.php (child)Thank you
Forum: Fixing WordPress
In reply to: .addClass JS/JQUERYThis version is the live one that I have not modified yet. Unfortunately the modified version of my website is on a local server via wamp.
Forum: Fixing WordPress
In reply to: .addClass JS/JQUERYI am actually working on a local server via wamp because my website is live right now.
https://www.thesofachronicle.com here is the unmodified version of the website (meaning that the wp_enqueue_script has not been use on the live version)
Forum: Fixing WordPress
In reply to: .addClass JS/JQUERYAnd I have this error message appearing on my consol un brackets
‘jQuery’ was used before it was defined. var mywindow=Jquery(window)
Missing ‘use strict’ statement. var mywindow=Jquery(window)
Forum: Fixing WordPress
In reply to: .addClass JS/JQUERYThanks for the answer. So, I made the correction, however I still have nothing appearing next to my header. The class doesn’t add to the header section.
Forum: Fixing WordPress
In reply to: Enqueue jQuerry: Fatal error: Call to undefined function jQuery() inThank you very much for your help! I have tried to use the console to debug my code without success.
I think I just don’t have the right skills yet (being a beginner at PHP/JS). So the best things to do right now is just to explain what I am trying to achieve:
I want to add a class to my header on scroll to be able to restyle it => make it sticky, integrate my logo on the left/right side in a smaller version, etc.
If anyone has any ideas on how to do that thanks for your help. ??
Forum: Fixing WordPress
In reply to: Enqueue jQuerry: Fatal error: Call to undefined function jQuery() inThanks for the help. I have tried to make the changes, unfortunately it does not work. It does not add my class.
Because I am new at PHP and Javascript/jQuery, I can’t figure it out.
Here is what I have so far
functions.php:
<?php function makeSticky() { wp_enqueue_script( 'makeSticky', get_template_directory_uri() . '/js/sticky.js', array('jquery'), false ); add_action( 'wp_enqueue_scripts', 'penscratch_scripts_child' ); } ?>
header.php:
<head> <script type="text/javascript" src="/js/sticky.js"></script> </head>
sticky.js
jQuery(document).ready(function($) { function makeSticky() { var myWindow = $( window), myHeader = $(".site-header"); myWindow.scroll(function() { if ( myWindow.scrollTop() == 0) { myHeader.removeClass( "sticky-nav"); } else { myHeader.addClass( "sticky-nav"); } }); }
I feel like I miss something in header.php, but I can’t figure it out. I went through the codex again and again, following the recommendations, without success.
Thank for any advice or help. I really appreciate!
Thanks
Teddy
Forum: Fixing WordPress
In reply to: Enqueue jQuerry: Fatal error: Call to undefined function jQuery() inThank you! I don’t get any errors anymore.
However, it doesn’t add the class .fixed to my header when scrolling down.
Forum: Plugins
In reply to: [LowerMedia Sticky.js Menus] Did the 3.1 update, sticky menu doesn't workHi,
Thanks for the answer. I actually figured it out by myself. It was nothing major.
Forum: Themes and Templates
In reply to: [Theme Penscratch] Font problemThanks a lot it worked perfectly!
Awesome.