• The theme i am using shows the author and the date in the ‘loop’ blog section but when you click through to read the full details of each post ‘single’ the author and date are missing.

    How do i add them?

    my single.php looks like this

    <?php get_header();
    if (get_post_meta($post->ID, "post_isportfolio", true) == 'use_portfolio_layout') {
     $portcat = get_the_category($post->ID, false);
     $portcat = $portcat[0];
     }
     ?>
    <?php require_once('title.php'); ?>
    <div class="content">
      <div class="wrap">
      <?php if( in_category( $portcat )  ) { ?>
       <div class="col1">
       <div class="breadcrumbs"><?php prosto_the_breadcrumb(); ?> </div>
          <?php require_once('loop.php'); ?>
        </div>
      <?php } else { ?>
      <div class="col1"><div class="breadcrumbs"><?php prosto_the_breadcrumb(); ?> </div></div>
      <?php if (rtl_check()) { ?> 
    
          <div class="col3 rightsidebar">
            <?php generated_dynamic_sidebar_prosto(1) ?>
        </div>
         <div class="col32">
          <?php require_once('loop.php'); ?>
        </div>
       <?php } else {?>
        <div class="col32">
          <?php require_once('loop.php'); ?>
        </div>
        <div class="col3 rightsidebar">
            <?php generated_dynamic_sidebar_prosto(1) ?>
        </div>
         <?php }?>
        <?php } ?>
      </div>
    </div>
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
  • Copy and paste the appropriate code from that page.

    If unsure, these snippets might provide a starting point:

    <p class="post-date">
    <span class="post-month"><?php the_time('M');?></span>
    <span class="post-day"><?php the_time('j');?></span>
    <span class="post-year"><?php the_time('Y');?></span>
    </p>
    
    See:   http://codex.wordpress.org/Function_Reference/the_time
    
     <span class="post-author"><?php the_author();?></span>
    
    http://codex.wordpress.org/Function_Reference/the_author
Viewing 1 replies (of 1 total)

The topic ‘Add a date to single post.’ is closed to new replies.