WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Post Subpages By Date (6 posts)

  1. chanel
    Member
    Posted 5 years ago #

    I would like for the date of when the subpages were created/posted on http://diaryofchanel.com/discuss. I have the pages sorted by post date, but I would like for that date to show.

    Right now it looks like this:

    1. domestic violence. (5 comments)
    2. abortion. (4 comments)

    I need it to look like this:

    3/1/09 - 1. domestic violence. (5 comments)
    3/8/09 - 2. abortion. (4 comments)

    I've already tried following the instructions on wp_list_pages.

  2. MichaelH
    Member
    Posted 5 years ago #

    With the help of the Template Hierarchy article, determine what Template is displaying "1. domestic violence", then paste the content of that template in a pastebin and report the link back here.

  3. chanel
    Member
    Posted 5 years ago #

    Hi Micheal H. Thanks for your reply. I named my pages with the numbers purposely so maybe you can ignore that part of it.

    Here is my Template:

    <?php
    /*
    Template Name: Discussions
    */
    ?>

    <?php get_header(); ?>

    <div id="side-left">
    <div id="content">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="kutu">
    <div class="ust"><span></span></div>

    <div class="post" id="post-<?php the_ID(); ?>">
    <h2 class="pagetitle"><?php the_title(); ?></h2>
    This section is an open forum for viewers to discuss & debate random topics per week. I will be posting "The Topic Of The Week" as it will allow us to converse about highlights of the media, politics, celebrity gossip, life & relationships, and parenting. Topics are posted in a numerical order (the highest number being the most recent topic) For those that are subscribed, you will receive an email notification when the new topic is posted! So if you're interested in being involved, please subscribe to my mailing list. Thank you.

    <div class="entrytext">
    <?php $children = get_pages('child_of='.$post->ID.'&show_date=modified
    &date_format=$date_format');if ($children) : ?>

    <?php endif; ?>
    </div>

    </div>
    <?php endwhile; endif; ?>
    <?php edit_post_link('Edit this entry.', '<p style="margin:10px;">', '</p>'); ?>
    <br class="clear" />
    <div class="alt"><span></span></div></div>
    </div>

    </div>
    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

  4. MichaelH
    Member
    Posted 5 years ago #

    Not sure what this is doing for you:

    <?php echo get_the_title($post->DATE); ?>

    so try this instead:

    <small><?php the_time('m.d.y') ?></small>
  5. chanel
    Member
    Posted 5 years ago #

    That worked Michael to show the date, but it just replaced the Subpage title with the date.

    * 02.28.09 (5 comments)
    * 03.08.09 (4 comments)

    That's what's there now.

  6. chanel
    Member
    Posted 5 years ago #

    Ok I fixed it. I implemented the other code back into the post:

    <?php echo get_the_title($post->DATE); ?> <small><?php the_time('m/d/y') ?></small>

    Thanks for the help Michael!

Topic Closed

This topic has been closed to new replies.

About this Topic