WordPress主題開發: 製做文章頁面single.php

能夠調用的文章內容:php

調用文章標題:<?php the_title(); ?>html

調用文章內容:<?php the_content(); ?>wordpress

調用文章摘要:<?php the_excerpt(); ?>函數

調用做者姓名:<?php the_author(); ?>post

調用文章發佈時間:<?php the_time(); ?>ui

調用做者的Gravatar頭像:<?php echo get_avatar( get_the_author_email(), 36 ); ?>spa

調用文章內容能夠寫:日誌

<?php echo the_content();?>

可是這個wordpress會自動在段落上加上p,解決方法能夠改成下面的寫法code

<?php 
$post=get_post(get_the_ID());
echo $post->post_content;
?>

 

post_author:(整數)文章做者的編號htm

post_date:(字符)文章發表的日期和時間(YYYY-MM-DD HH-MM-SS)

post_date_gmt:(字符)文章發表的格林尼治標準時間(GMT) (YYYY-MM-DD HH-MM-SS)

post_content:(字符)文章內容

post_title:(字符)文章標題

post_category:(整數)文章類別的編號。注意:該值在WordPress 2.1以後的版本總爲0。定義文章的類別時可以使用 get_the_category()函數。

post_excerpt:(字符)文章摘要

post_status:(字符)文章狀態(publish|pending|draft|private|static|object|attachment|inherit|future)

comment_status:(字符)評論狀態(open|closed|registered_only)

ping_status:(字符)pingback/trackback狀態(open|closed)

post_password:(字符)文章密碼

post_name:(字符)文章的URL嵌套

to_ping:(字符)要引用的URL連接

pinged:(字符)引用過的連接

post_modified:(字符)文章最後修改時間(YYYY-MM-DD HH-MM-SS)

post_modified_gmt:(字符)文章最後修改GMT時間(YYYY-MM-DD HH-MM-SS)

post_parent:(整數)父級文章編號(供附件等)

guid:(字符)文章的一個連接。注意:不能將GUID做爲永久連接(雖然在2.5以前的版本中它的確被看成永久連接),也不能將它做爲文章的可用連接。GUID是一種獨有的標識符,只是目前恰巧成爲文章的一個連接。

post_type:(字符)(日誌 | 頁面 | 附件)

 

 

經常使用:

發表於:<?php the_time('Y-h-d'); ?>
分類:<?php the_category(','); ?>

 引入評論框:

http://www.cnblogs.com/tinyphp/p/6366809.html

 

設置和獲取瀏覽次數:

http://www.cnblogs.com/tinyphp/p/6366022.html

相關文章
相關標籤/搜索