My question is very simple: is it possible to import many images at a time in a post (as the gallery does) But for example You can insert your post into the gallery without importing it into your post. After that, in a post template, you can ask them to display them with images attached to the post. Attachments are posts related to only one post, so let's get_posts (): I suggest keeping this function in function.ff file. In your single.php file: & lt; Ul & gt; Inside ? Gallery Import, I think, is the only way to import a group of images inside a post, but I can not handle HTML in this case. I might be wrong, but I did not find anything about it Thanks for your help.
function get_post_images ($ post) {$ args = array ('post_type' = Images associated with 'attachment', // post 'numberposts' => 1, // All attachments 'post_states' = & gt; null, // I 'post_parent' for gallery images => $ post - & gt; ID does not care about the original state of 'parent' 'boycott' = & gt; get_post_thumbnail_id ($ Post-> ID), // if you want it in your article list Are but somebody Insert 'post_mime_type' = & gt; 'image', // this attachment type 'order' = & gt; Exclude thumbnails from ASC, 'orderbie' = & gt; 'menu_order id', // order by menu_order By ID); Return get_posts ($ args); }
& lt; Ul & gt; & Lt ;? Php $ images = get_post_images ($ post); Foreign Currency ($ Images $ as Image):? & Gt; & Lt; Li & gt; & Lt ;? Php echo wp_get_attachment_image ($ image-> ID, 'medium'); ? & Gt; & Lt; / Li & gt; & Lt ;? Php endforeach; ? & Gt; & Lt; / Ul & gt; Li>
Comments
Post a Comment