Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function woo_post_meta( $section = '' ) {
- global $post;
- if ( ! defined( 'WOO_DATE_FORMAT' ) ) {
- define( 'WOO_DATE_FORMAT', get_option( 'date_format' ) );
- }
- $categories_obj = get_the_category( $post->ID );
- $prepared_categories = array();
- $the_category = '';
- if ( count( $categories_obj ) && ! is_wp_error( $categories_obj ) ) {
- foreach ( $categories_obj as $c ) {
- $prepared_categories[] = '<a href="' . get_term_link( $c->slug, 'category' ) . '">' . $c->name . '</a>';
- }
- if ( $section == 'more-news' ) {
- $the_category = $prepared_categories[0];
- } else {
- $the_category = join( ', ', $prepared_categories );
- }
- }
- ?>
- <div class="post-meta">
- <span class="category"><?php echo $the_category; ?></span>
- <span class="date"><?php echo the_time( WOO_DATE_FORMAT ); ?></span>
- <div class="fix"></div>
- </div>
- <?php
- }
Add Comment
Please, Sign In to add comment