
调用栏目(自动判断分类栏目):
{aspcms:navlist sort={aspcms:topsortid}}
{if:[navlist:sortid]=[navlist:cursortid] or [navlist:sortid]={aspcms:topsortid}}<img src="[navlist:pic]" width="980" height="300" />{end if}
{/aspcms:navlist}<ul class="e8">
{dede:list pagesize='12'}
<li>
<a href="[field:arcurl/]" class="pic"><img src="[field:litpic/]" alt="[field:title function='html2text(@me)'/]"/></a>
<a href="[field:arcurl/]" class="title">[field:title/]</a>
<span class="date"><small>最后更新:</small>[field:pubdate function="GetDateMK(@me)"/]</span>
</li>
{/dede:list}
</ul>很简单的办法,你单独加一个栏目,指定一个模版。
然后设置这个栏目为伪静态,然后在里面写get调用你想要的数据,即可实现分页显示。
如果像生成静态的话,那么就无法分页,需要修改php。
能用代码的就不要用插件了,解决方法如下:
1在主题文件夹中建thumbnailphp文件,添加如下代码:
<php if ( get_post_meta($post->ID,'thumbnail', true) ) : ><php $image =get_post_meta($post->ID, 'thumbnail', true); >
<a href="<php the_permalink() >"rel="bookmark" title="<php the_title();>"><img src="<php echo $image; >"alt="<php the_title(); >"/></a>
<php else: >
<!-- 截图 -->
<a href="<php the_permalink() >"rel="bookmark" title="<php the_title(); >">
<php if (has_post_thumbnail()) { the_post_thumbnail('thumbnail'); }
else { >
<img src="<php echocatch_first_image() >" width="140px"height="100px" alt="<php the_title(); >"/>
<php } >
</a>
<php endif;>
2 在主题文件夹里面的functionsphp文件中添加下面代码:
<php//支持外链缩略图
if ( function_exists('add_theme_support') )
add_theme_support('post-thumbnails');
function catch_first_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output =preg_match_all('/<img+src=[\'"]([^\'"]+)[\'"]>/i',$post->post_content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a defaultimage
$random = mt_rand(1, 2);
echo get_bloginfo ('stylesheet_directory' );
echo'/images/random/'$random'jpg';
}
return $first_img;
}
>
3在images文件夹下建立random文件夹,放入,必须已1jgp,2jpg这种格式。以数字1~10作为名字。
4在你放置的位置,用以下代码替换:
<php include( TEMPLATEPATH '/thumbnailphp' ); >一步一步跟着 *** 作就可以了。
这种实现也很简单,一般都是动态栏目项,保存在数据库中,比如数据库字段为:
id, item_name, item_type, item_icon
其中item_name='视频教程', item_icon='所对应的名称'
这样每个模块和自己的都一一对应了,并且不会混乱,所以你把所有的放在一个文件夹下,就很简单就能找到用哪个标签实际上无所谓
[ecmsinfo]1,10,32,0,0,1,1[/ecmsinfo]
调用对象选栏目即可了,在标签模板里调用文章的缩略图,就是前面加small,点进去是他的简介,可以设置会员空间,也可以是php文件的调用会员信息。完全可以实现。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)