Moving meta information (author, date) from bottom of post to top of post

Hi Aigars,

I am using Travelify version 4.0 for my new blog. Thanks for this fantastic theme! I have a question about moving author/date information from the bottom of a post to the top of a post:

I have followed your documentation (10. How to set up Blog Page) to set up full length blog posts on the home page of my blog.

However, on the home page, the meta information (author, date, categories) appears at the bottom of the post: www.patentprosolutions.com

When I click on an individual post, the meta information appears at the top of the post, under the title: www.patentprosolutions.com/to-improve-patent-quality-train-better-patent-prosecutors/

I would like the meta information on the home page to appear at the top of the post, under the title, like it does for an individual post. Can you help me with this?

Thanks again!

-Neil

Hi Neil,

I hope you are well today and thank you for your question.

You can move the meta information (author, date) from bottom of post to top of posy by adding the following code in the functions.php file of your child theme or add it in your site using any of the following plugins.

if ( ! function_exists( 'travelify_theloop_for_template_blog_full_content' ) ) :
/**
 * Fuction to show the content of page template full content display.
 */
function travelify_theloop_for_template_blog_full_content() {
    global $post;

    global $wp_query, $paged;
    if( get_query_var( 'paged' ) ) {
        $paged = get_query_var( 'paged' );
    }
    elseif( get_query_var( 'page' ) ) {
        $paged = get_query_var( 'page' );
    }
    else {
        $paged = 1;
    }
    $blog_query = new WP_Query( array( 'post_type' => 'post', 'paged' => $paged ) );
    $temp_query = $wp_query;
    $wp_query = null;
    $wp_query = $blog_query;

    global $more;    // Declare global $more (before the loop).

    if( $blog_query->have_posts() ) {
        while( $blog_query->have_posts() ) {
            $blog_query->the_post();

            do_action( 'travelify_before_post' );
?>
    <section id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
        <article>

            <?php do_action( 'travelify_before_post_header' ); ?>

            <header class="entry-header">
                <h2 class="entry-title">
                    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute();?>"><?php the_title(); ?></a>
                </h2><!-- .entry-title -->
            </header>

            <div class="entry-meta-bar clearfix">
                <div class="entry-meta">
                        <span class="author"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a></span>
                        <span class="date"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( get_the_time() ); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a></span>
                        <?php if( has_category() ) { ?>
                        <span class="category"><?php the_category(', '); ?></span>
                    <?php } ?>
                        <?php if ( comments_open() ) { ?>
                        <span class="comments"><?php comments_popup_link( __( 'No Comments', 'travelify' ), __( '1 Comment', 'travelify' ), __( '% Comments', 'travelify' ), '', __( 'Comments Off', 'travelify' ) ); ?></span>
                    <?php } ?>
                </div><!-- .entry-meta -->
            </div>

            <?php do_action( 'travelify_after_post_header' ); ?>

            <?php do_action( 'travelify_before_post_content' ); ?>

            <div class="entry-content clearfix">
                <?php
                    $more = 0;       // Set (inside the loop) to display content above the more tag.

                    the_content( __( 'Read more', 'travelify' ) );

                    wp_link_pages( array(
                        'before'            => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'travelify' ),
                        'after'             => '</div>',
                        'link_before'       => '<span>',
                        'link_after'        => '</span>',
                        'pagelink'          => '%',
                        'echo'              => 1
               ) );
                 ?>
            </div>

            <?php do_action( 'travelify_after_post_content' ); ?>

            <?php do_action( 'travelify_before_post_meta' ); ?>

            <?php do_action( 'travelify_after_post_meta' ); ?>

        </article>
    </section>
<?php
            do_action( 'travelify_after_post' );

        }
        if ( function_exists('wp_pagenavi' ) ) {
            wp_pagenavi();
        }
        else {
            if ( $wp_query->max_num_pages > 1 ) {
            ?>
                <ul class="default-wp-page clearfix">
                    <li class="previous"><?php next_posts_link( __( '&laquo; Previous', 'travelify' ), $wp_query->max_num_pages ); ?></li>
                    <li class="next"><?php previous_posts_link( __( 'Next &raquo;', 'travelify' ), $wp_query->max_num_pages ); ?></li>
                </ul>
                <?php
            }
        }
    }
    else {
        ?>
        <h1 class="entry-title"><?php _e( 'No Posts Found.', 'travelify' ); ?></h1>
      <?php
   }
   $wp_query = $temp_query;
    wp_reset_postdata();
}
endif;

Best Regards,
Vinod Dalvi