• I’m using this code to display attachments to a post in a custom gallery on a couple of sites.

    <?php
    $the_cat = get_the_category();
    $category_name = $the_cat[0]->cat_name;
    $category_description = $the_cat[0]->category_description;
    $category_link = get_category_link( $the_cat[0]->cat_ID );
    $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    
    	echo '<div class="titleblock-2"><p>';
    	echo customTitle(50);
    	echo '</p></div>';
    
    	$attachments = get_posts(array
    		(
    		'post_type' => 'attachment',
    		'numberposts' => -1,
    		'post_status' => 'published',
    		'post_parent' => $post->ID,
    		'orderby' => 'post__in',
    		'order' => ''
    		)
    	);
    
    	if ( $attachments ) {
    		echo '<div id="singlegallery">';
    		foreach ( $attachments as $attachment ) {
    			$attachment_page = get_attachment_link( $attachment->ID );
    			echo '<div class="big-thumb"><div class="gallery-icon"><a href="';
    			echo wp_get_attachment_url( $attachment->ID );
    			echo '">';
    
    			$myimage = preg_replace( '/(width|height)=\"\d*\"\s/', "", wp_get_attachment_image($attachment->ID, medium) ); echo $myimage; 
    
    			echo '</a></div></div>';
    			}
    		echo '</div>';
    		} 
    
    ?>

    It works, but in WP 3.5 but I can’t re-order the images using the media upload tool. Changes are shown in the editor, and if I use the WP shortcode to render the gallery. Changes don’t show in my custom gallery code though and that’s the problem.

    For a variety of reasons I can’t use the shortcode. All and any help appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Gallery Rendering in WP 3.5 order problem’ is closed to new replies.