0
<div class="text_area">
    <?php 
if ( have_posts() ) {
while ( have_posts() ) {
    the_post(); 
    the_content();
} // end while
} // end if
?>
      <div class="publish_date">Post Date: <?php the_time('F jS, Y');?> By <?php the_author_posts_link(); ?><?php _e( ' Posted in' ); ?> <?php the_category( ', ' ); ?>· Tags: <a href="#">CSS</a> · <a href="#">Web Design</a> · <a href="#">Full Story</a></div>
    </div>

For first post, It shows the title but for second it directly start with content without showing the POST TITLE.

1

This part

<div class="publish_date">Post Date: <?php the_time('F jS, Y');?> By <?php the_author_posts_link(); ?><?php _e( ' Posted in' ); ?> <?php the_category( ', ' ); ?>· Tags: <a href="#">CSS</a> · <a href="#">Web Design</a> · <a href="#">Full Story</a></div>
    </div>

should be inside the loop (just above or below your call to the_content();), not outside

For further info and reading, check out the loop in the codex

Also, please properly indent your code. Proper indentation makes debugging easier, is easier to read, better supported by code editors and looks neater

EDIT

Here is an example of the twenty fourteen contents inside the loop

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <?php twentyfourteen_post_thumbnail(); ?>

    <header class="entry-header">
        <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
        <div class="entry-meta">
            <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
        </div>
        <?php
            endif;

            if ( is_single() ) :
                the_title( '<h1 class="entry-title">', '</h1>' );
            else :
                the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
            endif;
        ?>

        <div class="entry-meta">
            <?php
                if ( 'post' == get_post_type() )
                    twentyfourteen_posted_on();

                if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
            ?>
            <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
            <?php
                endif;

                edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' );
            ?>
        </div><!-- .entry-meta -->
    </header><!-- .entry-header -->

    <?php if ( is_search() ) : ?>
    <div class="entry-summary">
        <?php the_excerpt(); ?>
    </div><!-- .entry-summary -->
    <?php else : ?>
    <div class="entry-content">
        <?php
            the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) );
            wp_link_pages( array(
                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
                'after'       => '</div>',
                'link_before' => '<span>',
                'link_after'  => '</span>',
            ) );
        ?>
    </div><!-- .entry-content -->
    <?php endif; ?>

    <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?>
</article><!-- #post-## -->
  • Thanks for your time ..I 'll put my code properly from next time. But still post title is missing for second post . – Rohil_PHPBeginner Sep 8 '14 at 8:14
  • Just add the_title(); inside your loop – Pieter Goosen Sep 8 '14 at 8:37
0

You would add the code for your date to your content.php file inside the entry-meta div and after the entry title as you can see in this basic example:

<h1 class="entry-title">
            <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
        </h1>

        <div class="entry-meta">
            <div class="publish_date">Post Date: <?php the_time('F jS, Y');?> By <?php the_author_posts_link(); ?><?php _e( ' Posted in' ); ?> <?php the_category( ', ' ); ?>· Tags: <a href="#">CSS</a> · <a href="#">Web Design</a> · <a href="#">Full Story</a></div>
    </div>
        </div><!-- .entry-meta -->

Here's the position in the Twenty Thirteen themes content.php file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.