Tag Info

New answers tagged

0

I don't have enough reputation to reply to comment on your answer, so I will post it here: I had similar problem, and answer why class selector works (and id don't) is because on widgets page, that element appears twice (on left side to select it and drag to the right), and on the right side, in appropriate sidebar area. So, that element and everything in it ...


0

Lazy Load really does not require no coding, you can use the Lazy Load plugin (just activate it). I also suggest providing different thumbnail sizes on the basis of the required dimension for the position (and you could even deliver them differently on the basis of the screen size, if you wish, to allow rensponsive themes work well). Other ideas can be ...


0

Short, a new database table would be an absolute overkill. I think, what you want to do is pretty much resembling the existing menu_order column in wp_posts. Using post meta is just fine, but add it on the the singular staff member posts from your custom post type. So you will have several custom order metas saved for them. And then retrieve the posts ...


0

Wordpress provides callbacks for widgets interactions. You're seems interested in two of them: widget-added, widget-updated Usage example: jQuery(document).on('widget-updated', function(e, widget){ // do your awesome stuff here // "widget" represents jQuery object of the affected widget's DOM element });


1

@BODA82 answer helped, but eventually I realized that I should have replaced responseText with responseJSON method in my javascript code. In the example below I was storing the ajax response results in a variable. I didn't know there was a specific method to get response in JSON. In such way the object/array with get_posts() results is returned correctly and ...


1

Almost there with your PHP function. No need to set the header. (Edit: Also, assuming get_posts() is actually returning results.) function myAjaxFunc() { $posts = get_posts( array( 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC', 'post_type' => 'my-post-type', ...


1

To the best of my knowledge, no, the async-upload process on the WordPress side does not support chunking from plupload. You can find this code in /wp-admin/async-upload.php. To handle the uploaded file, it calls the wp_ajax_upload_attachment() function, in the ajax-actions.php file. This function refers directly to the PHP $_FILES array, meaning that the ...


0

Because WordPress loads jQuery in no conflict mode, $ is not accessible as a global variable. You need to explicitly use jQuery. jQuery(document).ready(function () { jQuery("#login").loginWidget({ partnerRef: 0000, }); }); If, like me, you want to use $ anyway, you can pass it to the ready function. jQuery(document).ready(function ($) { ...


2

Your main issue with your code is that you aren't wrapping your JS in a <script> element. <?php /* Template Name: Price Chart */ /** * Enqueue the table sorter script */ function load_table_sorter_scripts() { //wp_enqueue_style( 'style-name', get_stylesheet_uri() ); wp_enqueue_script( 'tablesorter', get_template_directory_uri() . ...


2

While your script loop is quite clever, it appears that the fullscreen script is not loading before your script.js is. Which is the problem. I would change your enqueues to this and try again. After another glance, I believe the issue is that you have fullpage.min which is trying to be used as the ID of the script. I think that . is an invalid character, ...


0

I guess I'm just too tired. This helped: <input type = "hidden" name = "page" value = "pluginname/pluginfile.php_pluginfunction " />


1

WordPress has default jQuery. So, no need to load this file explicitly. JS Code: jQuery('#toggle-onoff-network').on({ 'click': function () { var origsrc = jQuery(this).attr('src'); var src = ''; if (origsrc == 'img1_on.png') src = 'img2_on.png'; if (origsrc == 'img2_on.png') src = 'img1_on.png'; jQuery(this).attr('src', src); } }); // ...


0

Try this: <script type="text/javascript" charset="utf8"> jQuery(function($){ $('img').each( function() { var mySrc = $(this).attr( "src" ); $(this).wrap( '<a href="'+mySrc+'" class="link"></a>' ); }); }) </script>



Top 50 recent answers are included