wordpress标签库 wordpress标签页插件-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

wordpress标签库 wordpress标签页插件

wordpress常用的标签有哪些怎么调用

常用的有标题、内容、日志元数据等。

成都创新互联公司坚持“要么做到,要么别承诺”的工作理念,服务领域包括:成都网站制作、成都网站设计、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的成华网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!

循环介绍

?php if (have_posts()) : ?

?php while (have_posts()) : the_post(); ?

?php endwhile; ?

?php endif;?

· if(have_posts()) – 检查博客是否有日志。

· while(have_posts()) – 如果有日志,那么当博客有日志的时候,执行下面 the_post() 这个函数。

· the_post() – 调用具体的日志来显示。

· endwhile; – 遵照规则 #1,这里用于关闭 while()

· endif; – 关闭 if()

调用标题

a href=";?php the_permalink() ?"?php the_title_attribute(); ?/a

标题太长了可以用下面的:

a href=";?php the_permalink() ?" ?php echo mb_strimwidth(get_the_title(), 0, 32, '...'); ?/a

调用内容

3-1、全文调用

?php the_content(); ?

3-2、摘要调用

?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post-post_content)), 0, 200,"……"); ?

日志元数据

4-1、发布日期

?php the_time('F d, Y') ?

?php the_time('m-d') ?

?php the_date_xml()?

4-2、所属分类

?php the_category(', ') ?

4-3、文章标签

?php the_tags('标签: ', ', ', ''); ?

4-4、留言数

?php comments_number('暂无评论', '1条评论', '% 评论' );?

4-5、更多按钮

a href=";?php the_permalink() ?"更多内容/a

4-6、调用文章作者

?php the_author_posts_link();?

最新文章调用:

语法

WP标签:?php wp_get_archives('type=postbypostlimit=10'); ?

type=postbypost:按最新文章排列limit:限制文章数量最新10篇调用随机文章:

?php

global $post;

$postid = $post-ID;

$args = array( 'orderby' = 'rand', 'post__not_in' = array($post-ID), 'showposts' = 10);

$query_posts = new WP_Query();

$query_posts-query($args);

?

?php while ($query_posts-have_posts()) : $query_posts-the_post(); ?

lia href=";?php the_permalink(); ?" rel="bookmark" title="?php the_title_attribute(); ?"?php the_title(); ?/a/li

?php endwhile; ?文章日期存档调用

WP标签:?php wp_get_archives( 'type=monthly' ); ?

type=monthly按月份读取

分类目录调用

WP标签:?php wp_list_cats('sort_column=nameoptioncount=1hierarchical=0'); ?

hierarchial=0 – 不按照层式结构显示子分类

optioncount=1 – 显示每个分类含有的日志数

sort_column=name – 把分类按字符顺序排列

友情链接调用

?php wp_list_bookmarks('title_li=categorize=0orderby=randlimit=24'); ?

元数据调用

注册:?php wp_register(); ?

登录:?php wp_loginout(); ?

wordpress里面怎样添加新的标签

两种方法,一种在添加文章的时候填写相关标签;另一种直接在标签库添加。

wordpress标签有什么用

wordpress标签是把文章中某些特点,特色拿出来标注,就好比说张三这个人贪吃,懒惰,爱睡觉一样的。

在实际wordpress建站时,标签可以起到引导访客访问的作用,还有seo优化方面也有很好的用处。


分享名称:wordpress标签库 wordpress标签页插件
分享链接:http://kswsj.cn/article/doghjsi.html

其他资讯