Interest.MP » 收集宝库 » WordPress常用函数列表

WordPress常用函数列表

取得时间:
2009/05/8 17:06 <?php the_time(’ Y/m/j G:i’) ?><?php the_time(’Y m/j’) ?>

分页:
<?php wp_list_pages(); ?>
<?php wp_list_pages(’title_li=<h2>Page</h2>’); ?>

文章列表:
<?php wp_list_categories(); ?>

文章代码:
<?php post_class() ?>

显示目前文章的类别,以,分隔:
<?php the_category(’,’) ?>
<?php the_category(’separator’, ‘parents’ ); ?>
’separator’分隔符  ,‘parents’ 阶层:‘multiple’ 分开类别 ’single’  链接类别(预设)
网络知识库(blog) >wordpress 视觉大师     : <?php the_category(’ &gt;’, ‘multiple’ ); ?>
网络知识库(blog) >wordpress 视觉大师 : <?php the_category(’ &gt;’, ’single’ ); ?>

文章标题:
<?php the_title(); ?>

文章网址:
<?php the_permalink(); ?>

文章内容:
<?php the_content(); ?>

文章摘要:
<?php the_excerpt(); ?>

文章id:
<?php the_ID(); ?>

文章标签:
<?php the_tags( ”, ‘, ‘, ”); ?>

文章作者:
<?php the_author(); ?>
<a href=”<?php the_author_url(); ?>”><?php the_author_nickname(); ?></a>

文章昵称:
<?php the_author_nickname(); ?>

文章引用:
<?php trackback_url(); ?>

显示文章作者的描述(作者个人资料中的描述):
<?php the_author_description(); ?>

显示文章作者的登录名:
<?php the_author_login(); ?>

显示文章作者的firstname(名):
<?php the_author_firstname(); ?>

显示文章作者的(姓):
<?php the_author_lastname(); ?>

显示文章作者的昵称:
<?php the_author_nickname(); ?>

显示文章作者的ID号:
<?php the_author_ID(); ?>

显示文章作者的电子邮箱:
<?php the_author_email(); ?>
<a href=”mailto:<?php echo antispambot(get_the_author_email()); ?>”>email</a>

显示文章作者的网站地址:
<?php the_author_url(); ?>

显示文章作者的网站地址:
<?php the_author_url(); ?>
<a href=”<?php the_author_url(); ?>”><?php the_author_url(); ?></a>
<?php if (get_the_author_url()) { ?><a href=”<?php the_author_url(); ?>”><?php the_author(); ?></a><?php } else { the_author(); } ?>

以文章作者名为链接名:
<?php the_author_link(); ?>

显示文章作者的aim:
<?php the_author_aim(); ?>

显示文章作者的yim:
<?php the_author_yim(); ?>

显示文章作者已发表文章的篇数:
<?php the_author_posts(); ?>

显示一个链接到文章作者已发表文章列表的链接:
<?php the_author_posts_link(); ?>

显示blog作者列表:
<?php wp_list_authors(’arguments’); ?>

订阅rss:
<?php post_comments_feed_link(’RSS 2.0′); ?>

留言板:
<?php comments_template(); ?>

日历:
<?php get_calendar(); ?>

会员注册:
<?php wp_register(); ?>

会员登入注销:
<?php wp_loginout(); ?>

分页:
<!–next page–>

文章中断:
<!–more–>

相关联结:
<?php wp_list_bookmarks(); ?>

文章搜寻:
<?php get_search_form(); ?>

回首页:
<a href=”<?php bloginfo(’url’); ?> ” title=”回首页”>回首页</a>

图片连结:
<img src=”<?php bloginfo(’template_directory’); ?>/images/logo.jpg” />

显示blog的标题:
<?php bloginfo(’name’); ?>

显示blog的网址:
<?php bloginfo(’url’); ?>

显示目前blog的网址:
<?php bloginfo(’description’); ?>

comments.php文件(评论):
<?php comments_template(); ?>

标签: , , ,



评头论足 榜 (1)

The-Reviewer…

Hi There!, I’ve gone ahead and bookmarked %BLOGURL% on Digg so my friends can see it too. I just used %BLOGTITLE% as the entry in my bookmark, as I figured if it is good enough for you to title your blog post that, then you probably would like to see i…