Home >CMS Tutorial >DEDECMS >How to call the first picture of the article content on the DEDE list page
How to call the first image of the article content on the DEDE list page?
DEDE list page calls the first picture (non-thumbnail) method of the article content
Recommended learning: Dream Weaver cms
Open ../ include/ common.func.php
Add code
//将缩放图转变为文章第一张图片 function firstimg($str_pic) { $str_sub=substr($str_pic,0,-7).".jpg";//删除缩略图字符串最后七位,然后再补上后缀.jpg return $str_sub; }
The calling method is:
[field:litpic function='firstimg(@me)'/]
The above is the detailed content of How to call the first picture of the article content on the DEDE list page. For more information, please follow other related articles on the PHP Chinese website!