• I am able to upload images and add them to posts, however when theming I see no images:

    $args = array(
    	            'order'          => 'ASC',
    	            'orderby'        => 'menu_order',
    	            'post_type'      => 'attachment',
    	            'post_parent'    => $post->ID,
    	            'post_mime_type' => 'image',
    	            'post_status'    => 'any',
    	            'numberposts'    => 1,
    
    	        );
    	        $attachments = get_posts($args);
    	        print_r($attachments);

    returns an empty array when used inside the loop. What am I doing wrong?

  • The topic ‘Attachments on posts not working’ is closed to new replies.