久久精品水蜜桃av综合天堂,久久精品丝袜高跟鞋,精品国产肉丝袜久久,国产一区二区三区色噜噜,黑人video粗暴亚裔

WordPress:Template Tags/get archives

來自站長百科
跳轉(zhuǎn)至: 導航、? 搜索

模板:取消

描述[ ]

向按日的存檔顯示一列鏈接??梢栽谝粋€模板內(nèi)的任何位置使用這個標簽。這個標簽與wp_get_archives()標簽類似。

取代[ ]

wp_get_archives().


用法[ ]

%%% <?php get_archives('type', 'limit', 'format', 'before', 'after', show_post_count); ?> %%%

例子[ ]

默認用法[ ]

使用默認設置,顯示歸檔鏈接。

<?php get_archives(); ?>

按月歸檔,顯示文章數(shù)目[ ]

在一個無序列表上顯示所有的歸檔,按月顯示文章的數(shù)目。

<ul>

<?php get_archives('monthly', '', 'html', '', '', TRUE); ?>
</ul>

在一個列表上顯示最近十篇文章[ ]

將十篇最近的文章按行分開,顯示在一個沒有bullet符號的列表上。

<?php get_archives('postbypost', '10', 'custom', '', '<br />'); ?>

使用下拉列表[ ]

在一個下拉列表上顯示按月的歸檔;需要使用javascript,以在網(wǎng)頁上擁有一個打開的歸檔選擇。 <form id="archiveform" action="">

<select name="archive_chrono" onchange="window.location =
(document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">
<option value=''>Select Month</option>
<?php get_archives('monthly','','option'); ?>
</select>
</form>

你也可以使用下面的這個代碼,比上面的例子中的代碼,運行地更好。這個代碼顯示了按月歸檔的列表,同時顯示了每月的歸檔文章的數(shù)目。

 <select name="archivemenu" onChange="document.location.href=this.options[this.selectedIndex].value;">
 <option value="">Select month</option>
 <?php get_archives('monthly',,'option',,,'TRUE'); ?>
 </select>

有限個最近文章的列表[ ]

在一個無序列表上顯示自定義數(shù)目最近文章的列表。

 <ul><?php 

<ul><?php get_archives('postbypost','10','custom','<li>','</li>'); ?></ul>

參數(shù)[ ]

type
(string) 需要顯示的歸檔列表的類型。默認為WordPress設置(在1.5版本中默認為'monthly')。有效的參數(shù)值:
  • 'monthly' (Default)
  • 'daily'
  • 'weekly'
  • 'postbypost'
limit
(integer) 得到的存檔文章的數(shù)目。使用'',沒有限制。
format
(string) 存檔列表的格式。有效的參數(shù)值:
  • 'html' - 在HTML列表(<li>)標簽中。這是默認設置的。
  • 'option' - 在精選的或者下拉列表選項(<option>)標簽。
  • 'link' - 在鏈接(<鏈接>)標簽內(nèi)部。
  • 'custom' - 自定義列表。
before
(string)為格式選項使用'custom' 或者'html'時,在鏈接前顯示的文本。默認為''。
after
(string) 為格式選項使用'custom' 或者'html'時,在鏈接后顯示的文本。默認為''
show_post_count
(boolean)顯示一個存檔中的文章數(shù)目(TRUE)或者不顯示(FALSE)。當類型設置為'monthly'的時候,可以使用。默認為FALSE。

相關的[ ]

要使用查詢字符串,傳遞參數(shù),產(chǎn)生一個歸檔列表,請看看wp_get_archives()

模板:標簽 總 標簽

模板:PHP 函數(shù) 標簽 頁底文字