Wordpress Get pictures in albums

Source: Internet
Author: User
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?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.