megwoo
6/24/2015 - 5:06 AM

WordPress Meta Info Replacement

To replace: get_template_part( 'post-meta' );

<div class="post-meta">
	<h2><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h2>						
	<?php the_time('F j, Y'); ?>  // formatting http://codex.wordpress.org/Formatting_Date_and_Time
	by <?php the_author(); ?>
	posted in <?php the_category(', ') ?>
	- <a href="<?php comments_link(); ?>"><?php comments_number( 'No Comments', '1 Comment', '% Comments' ); ?></a>
</div>


Featured Images
<?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> // image & url

the_post_thumbnail();                  // without parameter -> 'post-thumbnail'
 the_post_thumbnail( 'thumbnail' );       // Thumbnail (default 150px x 150px max)
the_post_thumbnail( 'medium' );          // Medium resolution (default 300px x 300px max)
the_post_thumbnail( 'large' );           // Large resolution (default 640px x 640px max)
the_post_thumbnail( 'full' );            // Full resolution (original size uploaded)

<img src="<?php the_post_thumbnail_url('full'); ?>" alt="<?php the_title(); ?>" />   // image path only



Post
<?php the_content(); ?>

Author Info
<div class="author-info">
	<div class="author-name"><a href="<?php the_author_meta('user_url'); ?>" target="_blank"><?php the_author(); ?></a></div>
	<div class="author-bio"><?php the_author_meta('description'); ?></div>
</div>

Post ID
<?php the_ID(); ?> 

Slug
<?php $slug = get_post_field( 'post_name', get_post()); ?>