smhmic
Forum Replies Created
-
Your code uses the global
$
variable — which is not a good practice. It worked only because your theme replaces the jQuery file loaded by WordPress with jQuery from Google CDN — also poor practice. It’s poor practice because WordPress loads jQuery in “noConflict” mode (which does not associate the$
variable with jQuery), and some plugins rely on noConflict mode.The Responsive Menu plugin breaks your code because it re-activates jQuery’s noConflict mode.
Your fix: replace
$
withjQuery
in this code:$(function(){ $('#testimonial-container-demo').mixItUp(); });
Forum: Plugins
In reply to: [Responsive Menu - Create Mobile-Friendly Menu] Not working with jQuery 1.8You’re right, mrfoxtalbot, your code is doing something wrong — it wouldn’t even work on stock WordPress. $ is not a function because WordPress loads jQuery in “noConflict” mode.
Solution: Change each of the “$”s to “jQuery” (note the case).
Forum: Plugins
In reply to: [Enhanced Media Library] grouping MIME type labelsI noticed something in the old-style media upload screen. (Using WP v3.9.1, but some plugins still employ the old-style media uploader.)
With a comma separator, filtering works, but the count for grouped mime types at the top is always zero, and PHP notices are thrown from wp-admin/includes/media.php on line 2316.
With a pipe separator, no notices are thrown, but no media items appear in the list (yet — strangely enough — the count is correct).
I was able to get the correct count and avoid the notices by using a pipe separator on the old media upload form…
// WordPress v3.9.1 function get_views() and old-style upload form expect // pipe separators, whereas media upload dropdown filter expects commas. $glue = in_array( $pagenow, array( 'upload.php', 'media-upload.php' ) ) ? '|' : ',';
… and get the media items to appear by adding this filter:
global $pagenow; if( 'media-upload.php' == $pagenow ) add_filter( 'pre_get_posts', 'old_media_upload_form_fix', 99 ); function old_media_upload_form_fix( $wp_query ) { if ( $query_var = $wp_query->get( 'post_mime_type' ) ) $wp_query->set( 'post_mime_type', str_replace( '|', ',', $query_var ) ); return $wp_query; }
Forum: Plugins
In reply to: [Enhanced Media Library] grouping MIME type labelsNote you can handle the comma vs pipe difference directly within the function, by choosing the character based on context. See my implementation below (implemented as a standalone filter):
add_filter( 'post_mime_types', 'group_post_mime_types', 99 ); function group_post_mime_types( $post_mime_types ) { // WordPress function get_views() expects pipe separators, // whereas media upload dropdown filter expects commas. global $pagenow; $glue = 'upload.php' == $pagenow ? '|' : ','; $mime_types_grouped_by_name = array(); foreach( $post_mime_types as $mime => &$labels ){ $mime_types_grouped_by_name[ $labels[0] ][ $mime ] = $labels; } $new_post_mime_types = array(); foreach ( $mime_types_grouped_by_name as $name => &$mime_labels ) { $new_post_mime_types[ implode( $glue, array_keys( $mime_labels )) ] = reset( $mime_labels ); } return $new_post_mime_types; }
I’ve tested and this works well in v3.9.1.
Forum: Plugins
In reply to: [WP-Cycle] Making wp-cycle responsivejQuery Cycle — the code that powers this plugin — is not responsive. There are some workarounds, all of which require a small bit of coding.
But if you are comfortable coding, then I recommend using a solution that doesn’t need to be hacked into behaving semi-responsively. I like this one: https://www.woothemes.com/flexslider/