首页>>织梦CMS

织梦列表有图片则显示没图片不显示(调用标签和写法详解)

调用标签:

[field:array runphp='yes']
@me = (strpos(@me['litpic'],'defaultpic') ? "" : "
<a href='{@me['arcurl']}' class='preview'><img src='{@me['litpic']}'/></a>");
[/field:array]


写法:

<div id="recent-content" class="content-list">
    <div class="posts-loop clear">
{dede:arclist  row='20' titlelen='120 orderby ='pubdate'  channelid='1,2,3,4,5'}

<div id="post-191546" class="clear post-191546 post type-post status-publish format-standard has-post-thumbnail hentry category-wenji">    
            [field:array runphp='yes']  
            @me = (strpos(@me['litpic'],'defaultpic') ? "" :  "
                    <a target='_blank' class='thumbnail-link' href='{@me['arcurl']}'>
                <div class='thumbnail-wrap'>
                        <img width='295' height='193' src='{@me['litpic']}' class='attachment-iux_list_thumb size-iux_list_thumb wp-post-image' alt='{@me['title']}' loading='lazy'>
                </div>
            </a>");
            [/field:array]
    <header class="entry-header">
        <span class="entry-category">
            <a target="_blank" href="[field:typeurl/]">[field:typename/]</a>     
        </span>
    <h2 class="entry-title"><a target="_blank" href="[field:arcurl/]">[field:title/]</a></h2>
    </header>
    <div class="entry-overview     ">
        <div class="entry-meta">
            <span class="entry-date">[field:pubdate function="MyDate('Y-m-d',@me)"/]</span>
                        <span class="entry-like">
                    <span class="sl-wrapper"><a href="#" class="sl-button sl-button-191546" data-nonce="9832b2c5ab" data-post-id="191546" data-iscomment="0" title="点赞这篇文章"><span class="sl-count"><i class="fa fa-thumbs-o-up"></i> 0<em>赞</em></span></a><span class="sl-loader"></span></span></span>
                    <span class="entry-views"><a href="[field:arcurl/]"><i class="flaticon-eye"></i>[field:click/]<em>阅读</em></a></span>
</div>
            <div class="entry-summary">
                <p>[field:description function="cn_substr(@me,186)"/]...</p>
            </div>
    </div>
</div>
{/dede:arclist}
</div>

本文由乐乐博客织梦CMS栏目发布,感谢您对乐乐博客的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人站长或者朋友圈,但转载请说明文章出处“织梦列表有图片则显示没图片不显示(调用标签和写法详解)

标签: