wordpress中常用的一些php代碼
阿新 • • 發佈:2018-01-14
16px ext 信息 列表 emp 登錄 scrip post hid
<?php the_author(); ?> 顯示文章的作者
<?php the_author_description(); ?> 顯示文章作者的描述(作者個人資料中的描述)
<?php the_author_login(); ?> 顯示文章作者的登錄名
<?php the_author_firstname(); ?> 顯示文章作者的firstname(名)
<?php the_author_lastname(); ?> 顯示文章作者的lastname(姓)
<?php the_author_nickname(); ?> 顯示文章作者的昵稱
<?php the_author_ID(); ?> 顯示文章作者的ID號
<?php the_author_email(); ?> 顯示文章作者的電子郵箱
<?php the_author_url(); ?> 顯示文章作者的網站地址
<?php the_author_link (); ?>(添加於2.1版本) 顯示一個以文章作者名為鏈接名,鏈接地址為文章作者的網址的鏈接。
<?php the_author_icq(); ?> (不推薦使用) 顯示文章作者的icq
<?php the_author_aim(); ?> 顯示文章作者的aim
<?php the_author_yim(); ?> 顯示文章作者的yim
<?php the_author_msn(); ?> (不推薦使用) 顯示文章作者的msn
<?php the_author_posts(); ?> 顯示文章作者已發表文章的篇數
<?php the_author_posts_link(); ?> 顯示一個鏈接到文章作者已發表文章列表的鏈接
<?php list_authors(); ?> (不推薦使用) 顯示blog所有作者和他們的相關信息。完整函數如下:
參數:
optioncount:是否顯示各作者已發表文章的篇數,可選值為:TRUE 和 FALSE(默認值)
exclude_admin:是否不列出管理員,可選值為:TRUE(默認值) 和 FALSE
show_fullname :是否顯示各作者的全名,可選值為:TRUE 和 FALSE(默認值)
hide_empty:是否不顯示發表文章數為0的作者,可選值為:TRUE(默認值) 和 FALSE
feed:鏈接到各個作者發表文章的RSS供稿種子鏈接名,默認為空,不顯示RSS供稿種子
feed_image:供稿種子的圖片地址,如果提供此項,則覆蓋上面的feed,默認為空
<?php wp_list_authors(); ?> 顯示blog作者列表,如果作者發表過文章,則他的名字將鏈接到他發表的文章列表中。可定義是否顯示其他信息。
參數:
optioncount:是否顯示各個作者發表文章數,可選值:true 和 false(默認值)
exclude_admin:是否不顯示”admin”用戶,可選值:true(默認值) 和 false
show_fullname:是否顯示各個作者的全名,如果不顯示,將顯示昵稱。可選值:true 和 false(默認值)
hide_empty:是否不顯示發表文章數為0的作者,可選值:true(默認值) 和 false
feed:鏈接到各個作者發表文章的RSS供稿種子鏈接名,默認為空,不顯示RSS供稿種子
feed_image:供稿種子的圖片地址,如果提供此項,則覆蓋上面的feed,默認為空。
wordpress中常用的一些php代碼