Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Prints meta info of a post
- */
- function wpfelix_entry_meta()
- {
- ob_start();
- if ( get_theme_mod( 'post_date', true ) || get_theme_mod( 'post_categories', true ) )
- {
- if ( get_theme_mod( 'post_date', true ) )
- {
- printf(
- '<li class="entry-posted-on">%1$s <a href="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></li>',
- esc_html__( '', 'wpfelix' ),
- esc_url( get_permalink() ),
- get_the_date( 'c' ),
- get_the_date( get_option( 'date_format' ) )
- );
- }
- if ( get_theme_mod( 'post_categories', true ) )
- {
- $cat_list = wp_get_post_categories( get_the_ID() );
- $featured_cat = get_theme_mod( 'featured_category', 0 );
- $hide_featured = get_theme_mod( 'featured_category_hide', true );
- if ( $hide_featured )
- {
- $cat_list = array_diff( $cat_list, array( $featured_cat ) );
- }
- if ( ! empty( $cat_list ) )
- {
- echo '<li class="entry-cat-links">';
- echo '<ul class="post-categories">';
- foreach ( $cat_list as $key => $cat )
- {
- $field_key = "field_5b4f3559d029b";
- $catID = the_category_ID();
- $field = get_field_object($field_key, $catID);
- echo $field['label'] . ': ' . $field['value'];
- printf(
- '<li><a href="%1$s" style="background:'. $field['value'] .'; border-color: '. $field['value'] .';">%2$s</a></li>',
- esc_url( get_category_link( $cat ) ),
- esc_html( get_cat_name( $cat ) )
- );
- }
- echo '</ul>';
- echo '</li>';
- }
- }
- }
- edit_post_link(
- sprintf(
- '<i class="fa fa-pencil"></i><span class="screen-reader-text"> %1$s %2$s</span>',
- esc_html( 'Edit', 'wpfelix' ),
- the_title( ' <span class="screen-reader-text">"', '"</span>', false )
- ),
- '<li class="entry-edit-link">',
- '</li>'
- );
- $output = ob_get_clean();
- if ( strlen( $output ) > 0 )
- {
- printf( '<ul class="entry-meta-above">%s</ul>', $output );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement