Tag Info

New answers tagged


I don't know why the code is not working. But this is how i did this may be helpful for some noob like me <?php $name = get_the_content(); preg_match('/\[gallery ids="([^]]*)\"]/', $name, $match); $w3_ids = explode( ",", $match[1] ); $gallery_count=1; foreach( $w3_ids AS $w3_id ): ...


<?php $id=the_ID(); $gallery_count = $wpdb->get_var("SELECT COUNT(ID) FROM {$wpdb->prefix}posts WHERE post_type = 'attachment' && ID=$id"); echo $gallery_count; ?> I think...!!! Try this for Particular gallery.


I'm not a very good coder, I've only asked questions on here, but because no one was able to answer your question, I suppose I'll give it a shot. If I remember correctly, this should remove the toolbars on the tinyMCE: function my_format_TinyMCE( $in ) { $in['toolbar1'] = ''; $in['toolbar2'] = ''; $in['toolbar'] = false; return $in; } ...


Your code is going to cause a fatal error as you have defined a function inside a loop, and therefore are redefining the function at every iteration thereafter. That is part of the problem. Take a look at cleaned up code: function pw_show_gallery_image_urls( $content ) { global $post; // Only do this on singular items if( ! is_singular() ) ...

Top 50 recent answers are included