Screen Options JavaScript Code

This is in wp-admin/js/common.js or wp-admin/js/common.min.js: // Scroll into view when focused $(‘#contextual-help-link, #show-settings-link’).on( ‘focus.scroll-into-view’, function(e){ if ( e.target.scrollIntoView ) e.target.scrollIntoView(false); }); Found with a search for show-settings-link in the complete source. 🙂

Assigning tags to a post from front end using tag-it jquery UI plugin

I added the fieldName parameter to tagit function like this: <script type=”text/javascript”> $(document).ready(function() { $(“#myTags”).tagit( { fieldName: “tages[]” } ); }); </script> Now I can echo $_POST[‘tages’]; since the HTML after execution became: <input type=”hidden” style=”display:none;” value=”d” name=”tages”> In addition, $_POST[‘tages’]; is a PHP array which I can directly put in second parameter of wp_set_object_terms. … Read more

Slider’s missing navigation

WordPress loads jQuery in “No Conflict” mode. The $ alias does not work. This is the cause of most of the “jQuery doesn’t work” questions on this site. Your code is using that $ alias, despite the Codex warnings against doing so. Use jQuery.(document) or wrap your code like… (function($) { $(function() { // more … Read more

Parse wordpress blog data using json api and ajax

Got this working: Added html += ”; html += ‘<li>’; html += ‘<a href=”‘ + entry.link + ‘”>’; html += ‘<div class=”entry”>’ + entry.title + ‘</div>’ ; html += ‘<div class=”entry”>’ + entry.author + ‘</div>’ ; html += ‘<div class=”entry”>’ + entry.publishedDate + ‘</div>’; html += ‘<div class=”entry”>’ + entry.contentSnippet + ‘</div>’; html += ‘</a>’; … Read more

After inserting jquery weather code, my responsive menu is lost

The reason the menu breaks is because the responsive menus are handled with a jQuery plugin. You are wiping out the jQuery object and all the jQuery plugins (which includes the responsive menu) when you include the zweatherfeed Javascript by including a second version of jQuery. The second version overwrites the first version. WordPress has … Read more

inner jQuery won’t work

Try this: jQuery(document).ready(function() { jQuery(‘#showmenu’).click(function() { jQuery(‘.menu’).slideToggle(“fast”); }); }); WordPress hates the $ statement. If you replace it with jQuery, it should work.

Load an action which is in an url with Jquery

$.load() is used to load content into an element. And you need to send a ping/request to a url, don’t need to use what is returned/responded. So, $.post() or $.get() the the solution for this. $.get(”, ‘wpfpaction=add&postid=350’); Usage With the current post id – $.get(”, ‘wpfpaction=add&postid=<?php the_ID(); ?>’); To dynamically add it from functions.php, you … Read more

Why won’t the Jquery validation plugin work?

You are mixing PHP and Javascript. The part between <script> must not be in the PHP code, but you could put it in the variable just after </form>. Another way of doing it would be to create a Javascript file myfunctions.js, putting the code into it and enqueueing it. The code would be: add_action( ‘wp_enqueue_script’, … Read more