Home  >  Article  >  CMS Tutorial  >  How to call the first picture of the article content on the DEDE list page

How to call the first picture of the article content on the DEDE list page

藏色散人
藏色散人Original
2020-01-04 09:14:252744browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn