我可以使用** wp_get_archives()**函数显示发布日期吗?

时间:2014-08-12 16:58:31

标签: php content-management-system wordpress-theming wordpress

我在WordPress主题开发方面相当新,我对 wp_get_archives()函数有疑问:http://codex.wordpress.org/Function_Reference/wp_get_archives

在我的网站中,我创建了以下页面模板,它使用 wp_get_archives()功能来显示帖子列表:

<?php 

    /**
     * Template Name: Posts Archive
     *
     * A custom page template for displaying all posts.
     *
     * The "Template Name:" bit above allows this to be selectable
     * from a dropdown menu on the edit page screen.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */

    get_header(); 

?>

<!-- Contenuti (griglia) -->
<div class="container">
    <!-- Lead presentazione -->
    <section id="presentazione">
        <div class="row">
            <div class="col-sm-12">
                <!--<h1 class="text-center"><small>Associazione per la Tutela dei Diritti Umani del Popolo Eritreo</small></h1>-->
                <h1 class="text-center title">Associazione per la Tutela dei Diritti Umani del Popolo Eritreo</h1>
                <h1 class="text-center leadTitle">Association in Defense of the Human Rights of the Eritrean People</h1>
                <!--
                <p class="lead text-center">
                    Association in Defense of the Human Rights of the Eritrean People
                </p>
                -->
            </div><!-- /.col-sm-12 -->
        </div><!-- /.row -->
    </section><!-- /section presentazione -->
    <!-- Progetti in evidenza -->

    <header class="header-sezione">
        <h2>Archivio post</h2>
    </header>

    <ul>
        <?php wp_get_archives('type=postbypost'); ?>
    </ul>

    </section>

</div>

<?php get_footer(); ?>

它有效,这就是结果(我只需要设置与字体大小相关的正确CSS):http://lnx.asper-eritrea.com/archivio/

好的,现在我的问题是:使用 wp_get_archives()功能可以在每个帖子之前显示发布日期吗?。

我想获得类似的东西:** 10/04/2014 - POST TITLE **而不仅仅是帖子标题。

我可以将一些参数传递给 wp_get_archives()函数吗?或者唯一的解决方案是不使用此功能并在我的模板页面中创建自定义循环?

0 个答案:

没有答案