If you insert only one gallery in the article that contains multiple images, is there any way to get pictures in the album as thumbnails?
Now think of two methods are proved invalid, one is to cooperate with the auto thumbnail plug-in and then get featured images
ID), array(100,100));echo $array_image_url[0];?>
The test is not valid and the picture in the album cannot be automatically set to a thumbnail image.
The second method is to get the first picture in the article, which is added by function.php:
function get_content_first_image($content){ if ( $content === false ) $content = get_the_content(); preg_match_all('||i', $content, $images); if($images){ return $images[1][0]; }else{ return false; }}
Then use it where it needs to be called:
"/>
The pictures in the album cannot be obtained after testing.
WordPress album is inserted by the short code [gallery id = "..."].
Is there any way to get the address of the picture attachment in the album?
Reply content:
If you insert only one gallery in the article that contains multiple images, is there any way to get pictures in the album as thumbnails?
Now think of two methods are proved invalid, one is to cooperate with the auto thumbnail plug-in and then get featured images
ID), array(100,100));echo $array_image_url[0];?>
The test is not valid and the picture in the album cannot be automatically set to a thumbnail image.
The second method is to get the first picture in the article, which is added by function.php:
function get_content_first_image($content){ if ( $content === false ) $content = get_the_content(); preg_match_all('||i', $content, $images); if($images){ return $images[1][0]; }else{ return false; }}
Then use it where it needs to be called:
"/>
The pictures in the album cannot be obtained after testing.
WordPress album is inserted by the short code [gallery id = "..."].
Is there any way to get the address of the picture attachment in the album?