Warning: Undefined array key "night" in /www/wwwroot/dhaomu.com/wp-content/themes/b2/header.php on line 18

织梦文章内容body图文分离调用代码

织梦教程:织梦DEDECMS教程文章内容body图文分离调用代码!织梦DEDECMS文章正文调用代码为{dede:field.body/},这样图片和文章都调用出来了。能不能分开调用呢?当然可以啦!

织梦教程:织梦DEDECMS文章内容body图文分离调用代码!织梦DEDECMS文章正文调用代码为{dede:field.body/},这样图片和文章都调用出来了。能不能分开调用呢?当然可以啦!

调用代码如下

内容文字

<div>
{dede:field.body runphp=yes}
$string = @me;
$result = preg_replace("/<s{0,}img[^>]+>/i",'',$string);
@me = $result;
{/dede:field.body}
</div>

内容图片

<div>
{dede:field.body runphp=yes}
$string = @me;
preg_match_all("/<img([^>]*)s*src=('|")([^'"]+)('|")/",$string,$matches);
$imgsrc_arr = array_unique($matches[3]);
foreach($imgsrc_arr as $imgsrc)
{
$result .= "<li><img class="img" src="$imgsrc"></li> ";
}
@me = $result;
{/dede:field.body}
</div>
温馨提示:
1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:duhaomu@163.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明

给TA赞赏
共{{data.count}}人
人已赞赏
编程技巧

让EcShop后台商品列表搜索关键字支持商品价格搜索

2023-1-8 0:00:00

编程技巧

将EcShop网站模板邮箱地址替换为手机号码

2023-1-11 0:00:00

0 条回复 A文章作者 M管理员

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914
----《》
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索