Wordpress obtains the image in the album.

Source: Internet
Author: User
If you insert only one Gallery in the article to contain multiple images, is there any way to obtain the images in the album as thumbnails? The two methods we have come up with prove invalid. one is to use the Autothumbnail plug-in and then obtain the special image {code ...} the test is invalid and cannot be performed... if you insert only one Gallery in the article to contain multiple images, is there any way to obtain the images in the album as thumbnails?

The two methods we have come up with prove to be ineffective. one is to use the Auto thumbnail plug-in to obtain the special image.


  ID), array(100,100));echo $array_image_url[0];?>

The test result is invalid. you cannot set the image in the album as a thumbnail automatically.

The second method is to get the first image in the article, and add it in 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 the following code to call:

"/>

Images in the album cannot be obtained after testing.
Wordpress album is inserted through the short code [gallery id =.
Is there any way to get the address of the image attachment in the album?

Reply content:

If you insert only one Gallery in the article to contain multiple images, is there any way to obtain the images in the album as thumbnails?

The two methods we have come up with prove to be ineffective. one is to use the Auto thumbnail plug-in to obtain the special image.


  ID), array(100,100));echo $array_image_url[0];?>

The test result is invalid. you cannot set the image in the album as a thumbnail automatically.

The second method is to get the first image in the article, and add it in 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 the following code to call:

"/>

Images in the album cannot be obtained after testing.
Wordpress album is inserted through the short code [gallery id =.
Is there any way to get the address of the image 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.