php - How to retrieve the first 4 images from post format image? -


I used this code to retrieve the first 4 videos within the video post format input.

  $ args = array ('Category-name' = & gt; Galleria-Video ',' Numberposts' => 4); Wp_reset_postdata (); $ Posts = get ($ args); $ Ytlink = array (); Forex Currency ($ post as $ post): setup_postdata ($ post); $ E = get_post_meta ($ post-> ID, 'post_video'); Array_push ($ ytlink, $ e [0]); Endforeach;  

But now I need to recover the first 4 images inside the post format gallery (single image or gallery), so I tried it without success:

  $ Args = array ('Category-name' = & gt; Galleria-Imagens', 'Numberposts' => 4); Wp_reset_postdata (); $ Posts = get ($ args); $ Imglink = array (); Forex Currency ($ post as $ post): setup_postdata ($ post); $ E = get_post_meta ($ post-> ID, 'Post_Gallery'); Array_push ($ igll, $ E [0]); Endforeach;  

What am I missing?


Comments