Problem adding MP3 attachments to a jPlayer playlist

Have a look at wp_localize_script for passing php data to javascript. A pseudo-code example: $tracks = array(); foreach( $mp3_attachments as $mp3_attachment ): $tracks[] = array( ‘mp3’ => $mp3_attachment[‘filename’], ‘title’ => $mp3_attachment[‘title’] ); endforeach; $wpa_track_data = array( ‘tracks’ => $tracks ); wp_enqueue_script( ‘wpa_script’, get_template_directory_uri() . ‘/js/yourscript.js’ ); wp_localize_script( ‘wpa_script’, ‘wpa_data’, $wpa_track_data ); Then in your js … Read more

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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)