wordpress标签 WordPress标签tagphp

如何查看WordPress分类目录、标签和文章的ID?

查看WordPress分类目录的ID\x0d\x0a进入仪表盘,打开“分类目录”管理界面,然后把鼠标移动到某一个分类目录名称上,这时就会在网页左下角显示当前分类目录的编辑页面地址。如图:\x0d\x0a\x0d\x0a我们可以看到在显示的网址中有“ID=***”的字符,那么其中显示的数字即为该分类目录的ID。\x0d\x0a查看WordPress标签的ID\x0d\x0a按照同上的方法,进入标签管理界面,我们把鼠标移动到某个标签上面,即可在页面左下角看到该标签的管理页面网址 ,这其中的“ID=”后所跟的数字即为该标签的ID。\x0d\x0a查看WordPress文章的ID\x0d\x0a同样的方法,在文章管理界面中,我们把鼠标移动到某篇文章的名称上,就会在页面左下角看到该篇文章的编辑页面网址 。这其中的“ID=”后所跟的数字即为该文章的ID。

成都创新互联从2013年开始,先为峡江等服务建站,峡江等地企业,进行企业商务咨询服务。为峡江企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

wordpress标签有什么用

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

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

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标签tagphp
转载注明:http://myzitong.com/article/ddsihgi.html