doumeng3188 2014-08-12 16:58
浏览 67

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

I am pretty new in WordPress theme development and I have some doubt about the wp_get_archives() function: http://codex.wordpress.org/Function_Reference/wp_get_archives

In my website I have create the following page template that use the wp_get_archives() function to show the posts list:

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

It work and this is the result (I only need to set the right CSS related to the font size): http://lnx.asper-eritrea.com/archivio/

Ok, now my question is: using the wp_get_archives() function can I show the post date before each posts?.

I want to obtain something like: ** 10/04/2014 - POST TITLE** rather than the mere post title.

Can I do it passing some parameters to the wp_get_archives() function? Or the only solution is do not use this function and create a custom loop into my template page?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度