Template file structure , wordpress hook for altering the template
Template file structure , wordpress hook for altering the template
Template file structure , wordpress hook for altering the template
since it runs on old jquery ,try adding the old jquery on your footer of your theme, add the jquery manually and add script noconflict. You can get jquery library list from google cdn View Sample
Oh okay.. I think I solved it. I put the script in the header.php (I think “into the loop” as they say?) just behind the opening <header>-tag: <body> <header> <script type=”text/javascript”> (function($) { $(document).ready(function(){ $(window).scroll(function(){ if ($(this).scrollTop() > 200) { $(‘#menu’).fadeIn(500); } else { $(‘#menu’).fadeOut(500); } }); }); })(jQuery); </script>
There are a few problems but the main one is when sidebarEffects.js is loaded the HTML it’s looking for doesn’t exist yet. So… var container = document.getElementById( ‘st-container’ ) // and buttons = Array.prototype.slice.call( document.querySelectorAll( ‘#st-trigger-effects > button’ ) ) are both empty when the script is run. Easiest way to fix it is to … Read more
its working now:- jQuery(function() { var $button = jQuery(‘#loginButton’); var $box = jQuery(‘#site-crhead’); var $form = jQuery(‘#loginForm’); $button.live(‘click’,function(login) { console.log($box); $box.toggle(); $button.toggleClass(‘active’); }); $form.live(‘click’,function() { return false; }); jQuery(this).live(‘click’,function(login) { if(!(jQuery(login.target).parent(‘#loginButton’).length > 0)) { $button.removeClass(‘active’); $box.hide(); } }); }); Just update your code according to you, even your mouseup function was not working, according to … Read more
It’s jQuery not JQuery. Try jQuery(‘div’).raty({ score: 3 });
You don’t specify how precisely your JS is output. If you are doing this inline from PHP you could just echo required data in place. If it’s just some arbitrary script, loaded as such, then the common practice in WP is to use wp_localize_script() to pass data from PHP runtime to an enqueued script. While … Read more
My AJAX requests take 30 seconds to complete
May i suggest: $(‘tr td .widget-remove a’).click(function(){ var toremove = $(this).attr(‘rel’); // Out of ideas – you shouldn’t really be for we are here! $.ajax({ type: ‘POST’, // use the method you want dataType: ‘json’, url: ajaxurl, // this is the url to the admin ajax script data: { nonce : your_script_data_object.nonce, toremove: toremove }, … Read more
I think your problem is here: $like_the_post = intval( $_POST[‘like_the_post’] ); You’re relying on the user’s browser’s POST input to determine whether to increment or decrement the count. When a user quickly clicks the button, the AJAX call hasn’t yet completed and changed the form input from true to false (or whatever’s vice-versa). Additionally, this … Read more