• Hi,
    I have problems to get some images with this code inserted in a post inside the category page:

    $args = array(
    	'numberposts' => 1,
    	'order'=> 'ASC',
    	'post_mime_type' => 'image',
    	'post_parent' => $pageChild->ID,
    	'post_status' => null,
    	'post_type' => 'attachment'
    	);
    	$attachments = get_children( $args );
    	if ($attachments) {
    		foreach($attachments as $attachment) {
    			$myimg= '<img src="'.wp_get_attachment_thumb_url( $attachment->ID ).'>';
    		}
    	}

    I read a lot of posts in this forum but nobody gave the right answer… please help me!!

  • The topic ‘get_children in archive’ is closed to new replies.