WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Display Meta-Data (9 posts)

  1. qtmcdowell
    Member
    Posted 4 months ago #

    I'm using the 2012 theme which from everything I've read should display the meta-data beneath each post, but for some reason I can't get it to show up.

    I'm using a child theme and added this <?php the_time('m/j/y g:i A') ?><br />

    Here is my site. http://www.freshsqueezedfitness.com

    to my header.php, but it showed up in the wrong place. Could someone tell me what I'm doing wrong? Thanks!

  2. alchymyth
    The Sweeper & Moderator
    Posted 4 months ago #

    should display the meta-data beneath each post, but for some reason I can't get it to show up

    you have hidden the output with this style in your child theme:

    footer.entry-meta {
    display: none;
    }

    if you want to show the date/time in a different place, the right file to add your code would be possibly be content.php

  3. qtmcdowell
    Member
    Posted 4 months ago #

    Ok thanks. I want a date below the post-title similar to this website. Any suggestions?

    http://pinchofyum.com

  4. alchymyth
    The Sweeper & Moderator
    Posted 4 months ago #

    for instance, edit content.php (in the child theme) and add your time code before this line:

    </header><!-- .entry-header -->

    wrap the code into a div for better formatting;
    example:

    <div class="entry-time"><?php the_time('m/j/y g:i A') ?></div>

    format it with
    .entry-time { .... }

  5. qtmcdowell
    Member
    Posted 4 months ago #

    Sorry I am new to this, does that mean I need to create another document to import into my child theme called content.php and then make the changes there?

    What code do I need to include to make sure it overrides the parent theme?

    Thanks for the help.

  6. alchymyth
    The Sweeper & Moderator
    Posted 4 months ago #

    http://codex.wordpress.org/Child_Themes

    working with a child theme is the recommended way of customizing themes (at least any of the default themes that come with WordPress, and themes that might get updated regularly).

  7. qtmcdowell
    Member
    Posted 4 months ago #

    Great, last question. Thanks.

    I think I got it to work except the time stamp is only showing up on the first blog post on my home page... any suggestions?

  8. alchymyth
    The Sweeper & Moderator
    Posted 4 months ago #

    it seems as if you have added the code at the end of header.php - not in content.php as suggested.

    to be shown with every post (standard post format) the timestamp code needs to be in content.php, at this marked location:

    .....
    			<?php else : ?>
    			<h1 class="entry-title">
    				<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
    			</h1>
    			<?php endif; // is_single() ?>
    INSERT TIME-STAMP CODE HERE
    		</header><!-- .entry-header -->
    
    		<?php if ( is_search() ) : // Only display Excerpts for Search ?>
    .....
  9. qtmcdowell
    Member
    Posted 4 months ago #

    Cheers, I finally got it to work. Thank you for the help.

Reply

You must log in to post.

About this Topic