mgsisk / webcomic

Comic publishing power for the web. Turn your WordPress-powered site into a comic publishing platform with Webcomic.
http://wordpress.org/plugins/webcomic
GNU General Public License v2.0
110 stars 29 forks source link

Need to also output the date in storyline archives #157

Closed metafarion closed 10 years ago

metafarion commented 11 years ago

For a little more detail on the Archives page, is there a parameter to feed to webcomic_list_storylines() to have it also output the date of the individual comics it lists? Or perhaps another way to accomplish the same thing?

tnog commented 11 years ago

You can use WordPress' inbuilt functions for displaying the pub dates for webcomic posts.

As an example I created a template for single webcomic posts and just inserted the following function that I put in my functions.php file:

// Custom publish date dislay for webcomic posts
function tn_cstm_pubdate() { 

  <div class="post-date">
      <time class="updated" datetime="<?php echo get_the_time('c'); ?>">
        <span class="post-month"><?php echo get_the_time('M'); ?></span><br />
        <span class="post-day"><?php echo get_the_time('d'); ?></span><br />
        <span class="post-year"><?php echo get_the_time('Y'); ?></span>
      </time>
  </div>

</div>

<?php }

Here in my custom template for single webcomic posts:


<?php get_header(); ?>

<!-- Row for main content area -->
    <div class="small-12 large-9 columns" role="main">      

        <?php /* Start loop */ ?>
        <?php while (have_posts()) : the_post(); ?>
            <article <?php post_class() ?> id="post-<?php the_ID(); ?>">
                <div class="row"> 

                    <header class="post-header large-3 small-12 columns">
                            <h1 class="entry-title small-9 large-12 columns"><?php the_webcomic_storylines(); ?></h1>
                                <?php tn_cstm_pubdate(); ?> 
                    </header>

                    <div class="webcomic-container large-9 small-12 columns">

                        <?php tn_cstm_webcomic_pagination(); ?>
                        <section class="webcomic-content entry-content">
                            <?php the_webcomic(); ?>
                        </section>
                        <?php tn_cstm_webcomic_pagination(); ?>
                    </div>

                </div>

                <?php //comments_template(); ?>
            </article>
        <?php endwhile; // End the loop ?>

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

<?php get_footer(); ?>
metafarion commented 11 years ago

This looks like it outputs the date for the current webcomic. Or am I missing something?

I'm looking for a way to display on the archive page, the date beside every comic listed.