The company uses wordpress to create a very simple article website. on the left side of the article list page, all the pictures in the article, and on the right side is the text description of the article.
The company uses wordpress to create a very simple article website. on the left side of the article list page, all the images in the article are displayed, and on the right side is the text description of the article. So how can we list all the images in the article?
First, write a function in function. php (create a function without function. php). The code is as follows:
Function all_img ($ soContent ){
$ SoImages = '~] * \/> ~ ';
Preg_match_all ($ soImages, $ soContent, $ thePics );
$ AllPics = count ($ thePics );
If ($ allPics> 0 ){
Foreach ($ thePics [0] as $ v ){
Echo $ v;
}
}
Else {
Echo "echo bloginfo ('Template _ url ');
Echo "/images/thumb.gif '> ";
}
}
Register_nav_menus (array (
'Primary '=> _ ('primary navigation '),
));
And then write the data where the call is required.
Post_content);?>
You can call