Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to call Wordpress 3.5 gallery images so they can be re-ordered?
    primarykey
    data
    text
    <p>I have a couple of sites which use Wordpress as a CMS. Both have custom rendered galleries using the following code below.</p> <pre><code>&lt;?php $the_cat = get_the_category(); $category_name = $the_cat[0]-&gt;cat_name; $category_description = $the_cat[0]-&gt;category_description; $category_link = get_category_link( $the_cat[0]-&gt;cat_ID ); $url = wp_get_attachment_url( get_post_thumbnail_id($post-&gt;ID) ); echo '&lt;div class="titleblock-2"&gt;&lt;p&gt;'; echo customTitle(50); echo '&lt;/p&gt;&lt;/div&gt;'; $attachments = get_posts(array ( 'post_type' =&gt; 'attachment', 'numberposts' =&gt; -1, 'post_status' =&gt; 'published', 'post_parent' =&gt; $post-&gt;ID, 'orderby' =&gt; 'menu_order', 'order' =&gt; '' ) ); if ( $attachments ) { echo '&lt;div id="singlegallery"&gt;'; foreach ( $attachments as $attachment ) { $attachment_page = get_attachment_link( $attachment-&gt;ID ); echo '&lt;div class="big-thumb"&gt;&lt;div class="gallery-icon"&gt;&lt;a href="'; echo wp_get_attachment_url( $attachment-&gt;ID ); echo '"&gt;'; $myimage = preg_replace( '/(width|height)=\"\d*\"\s/', "", wp_get_attachment_image($attachment-&gt;ID, medium) ); echo $myimage; echo '&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;'; } echo '&lt;/div&gt;'; } ?&gt; </code></pre> <p>My problem is that Wordpress 3.5 doesn't seem to be handle previously uploaded images to posts as it used to, and though the code produces a gallery, the images cannot be reordered within the WP admin interface. </p> <p>I have seen it suggested that attachments no longer work as they did and that there's another way to call the images using code like this:</p> <pre><code>$post_content = $post-&gt;post_content; preg_match('/\[gallery.*ids=.(.*).\]/', $post_content, $ids); $array_id = explode(",", $ids[1]); </code></pre> <p>Can someone help explain how this could be applied? The 'solution' of re-creating every gallery from scratch simply isn't an option here.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload