回首頁 wordpresswordpress常用函數
2009
05/13

wordpress常用函數

瀏覽:27,217人次
作者:英創達

取得時間: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(); ?>

DMSGuestbook 1.12.0留言版 <?php DMSGuestbook(); ?>

文章搜<?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(); ?>

 

顯示留言<?php comments_popup_link(‘No Comments >’, ’1 Comment >’, ‘% Comments >’); ?>
當彈留言的功能顯示的話,comments_popup_link()調用一個彈出的留言窗口。 
如果没有顯示,comments_popup_link() 則只是简单的顯示留言列表。
No Comments > 是在没有留言的时候顯示的。
1 Comment >是用於當你剛好有1條留言時候。
% Comments >;是用於當你有多於一條留言的時候。
 
以管理員登入<?php edit_post_link(‘Edit this entry’,”,’.'); ?>
 
編輯當前文章<?php edit_post_link(‘Edit this entry’,”,’.'); ?>
 
關閉循環<?php endwhile; ?>
 
關閉if <?php endif; ?>
 
分頁頁數<?php posts_nav_link(); ?>
<?php posts_nav_link(‘in between’,'before’,”after’); ?> 
<?php wp_list_cats(); ?>
 
blog管理、註冊連結<?php wp_register(); ?>
 
登出<?php wp_loginout(); ?>
 
是否有文<?php if(have_posts()) : ?>
如果有文章,就繼續尋循環<?php while(have_posts())?>

上篇文章<?php previous_post_link(‘&laquo; %link’) ?>
<?php previous_post(‘%’, ‘上一個作品’, ‘no’, ‘yes’,”,”) ; ?>

下篇文章<?php next_post_link(‘%link &raquo;’) ?>
<?php next_post(‘%’, ‘下一個作品’, ‘no’, ‘yes’); ?>

修改評論的大頭照尺寸<?php wp_list_comments(’avatar_size=60‘); ?>

瀏覽人數:<?php if(function_exists(‘the_views’)) { the_user_views(”, true); } ?>

VN:F [1.9.6_1107]
Rating: 8.5/10 (2 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)
wordpress常用函數, 8.5 out of 10 based on 2 ratings

留下您的意見

(若看不到驗證碼,請重新整理網頁。)