The list page we usually see is a thumbnail of the article by default. So, how to realize that the list can call the pictures of multiple articles?
Let me talk about the steps
Add function in include/extend.func.php
function Getpic($body) { KaTeX parse error: Can't use function '\"' in math mode at position 38: …h_all("/(src)=[\̲"̲|'| ]{0,}([^>]*…body,$img_array); i m g a r r a y = a r r a y u n i q u e ( img_array = array_unique( imgarray=arrayinnique(img_array[2]); if(count(KaTeX parse error: Expected '}', got 'EOF' at end of input: …)>0) { foreach(img_array as k e y = > key=> key=>value) { $picname = preg_replace("/["|’| ]{1,}/", ‘’, $value); g e t p i c . = " < p > < i m g s r c = ′ " . getpic .="<p><img src='". g e t p i c .="<p><imgsrc=′".picname."’ border=0 />
"; } } else { $getpic=“No image
”; } return $getpic; }Go to the website background-content model management, modify the additional list field of the ordinary article model to add body
How to call multiple pictures in the article from the dede list
List page templates use tags
{dede:list pagesize=“10” addfields=“body”}
- [field:title /][field:body function=“Getpic(@me)”/]
- {/ grandfather: list}