Hierarchical gallery

WordPress Posts (First level) Yes, the posts feature can be used as a gallery. WordPress provides nice short code to show all the attached images in post. While adding galleries make sure they point to attachment page not to the real file. When user clicks on any of image from the gallery they’ll get to … Read more

Hide the ‘Gallery Settings’ section of the Gallery tab of the media Thickbox

David, I’m not sure if you’re trying to disable the whole gallery (plus the settings) or only its fields. For the first option, you should try do deregister the admin-gallery script: function disable_gallery() { $post_id = (int) $_GET[‘post_id’]; // Check for your post / page ID if( $post_id == 343 ) { wp_deregister_script( ‘admin-gallery’ ); … Read more

Numberposts 1 not cooperating in 3.5

What do you mean by “isn’t liking what I’m doing for some reason.”? What happens? Does it break or just not return the amount you expected? Is the second query working? As for the trick of stripping shortcodes it’s just as easy as: <?php echo strip_shortcodes( get_the_content() ); ?>

How to show the image caption on custom post type …?

You should be able to use the caption from post_excerpt of the WP_Post object. $the_imgs = get_custom_field(‘gallery_img:to_array’); foreach( $the_imgs as $img ) { list( $url, $width, $height ) = wp_get_attachment_image_src( $img, ‘thumbnail’ ); $img_post = get_post( $img ); echo ‘<img src=”‘ . $url . ‘” width=”‘ . $width . ‘” height=”‘ . $height . ‘”> … Read more

Get raw image detail from post gallery?

A gallery is at heart just the set of attached posts, so… $post_id = 1; // set to your desired parent post $attachments = new WP_Query( array( ‘post_parent’ => $post_id, // post to which the gallery is attached ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, // ‘order’ => $order, // ‘orderby’ => $orderby … Read more

Why do all Gallery functions return null for me?

Okay, looks like it was my fault, I’ve been playing with shortcodes long time ago and I found out something like this within functions.php: require_once (‘gallery-shortcode.php’); Apparently it replaced the original shortcode and when it happens everything gallery-related breaks / returns nothing 🙂