Advertisement
cipher87

Post Meta Infos

Feb 24th, 2020
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.10 KB | None | 0 0
  1. function enfold_post_meta_infos() {
  2.     $output = "<div class='main_color'>";
  3.     $output .= "<span class='post-meta-infos'>";
  4.  
  5.     $output .= "<time class='date-container minor-meta updated' >" . get_the_time( get_option( 'date_format' ), get_the_ID() ) . '</time>';
  6.     $output .= "<span class='text-sep text-sep-date'>/</span>";
  7.  
  8.     // if ( get_comments_number( get_the_ID() ) != '0' || comments_open( get_the_ID() ) )
  9.     // {
  10.  
  11.         $output .= "<span class='comment-container minor-meta'>";
  12.         ob_start();
  13.         comments_popup_link(  '0 ' . __( 'Comments', 'avia_framework' ),
  14.                                 '1 ' . __( 'Comment', 'avia_framework' ),
  15.                                 '% ' . __( 'Comments', 'avia_framework' ),
  16.                                 'comments-link',
  17.                                 '' . __( 'Comments Disabled','avia_framework' )
  18.                 );
  19.         $output .= ob_get_clean();
  20.         $output .= '</span>';
  21.         $output .= "<span class='text-sep text-sep-comment'>/</span>";
  22.     // }
  23.  
  24.     $taxonomies  = get_object_taxonomies( get_post_type( get_the_ID() ) );
  25.     $cats = '';
  26.     $excluded_taxonomies = array_merge( get_taxonomies( array( 'public' => false ) ), array('post_tag','post_format') );
  27.     $excluded_taxonomies = apply_filters( 'avf_exclude_taxonomies', $excluded_taxonomies, get_post_type( get_the_ID() ), get_the_ID() );
  28.  
  29.     if( ! empty( $taxonomies ) )
  30.     {
  31.         foreach( $taxonomies as $taxonomy )
  32.         {
  33.             if( ! in_array( $taxonomy, $excluded_taxonomies ) )
  34.             {
  35.                 $cats .= get_the_term_list( get_the_ID(), $taxonomy, '', ', ', '' ) . ' ';
  36.             }
  37.         }
  38.     }
  39.  
  40.     if( ! empty( $cats ) )
  41.     {
  42.         $output .= '<span class="blog-categories minor-meta">' . __( 'in','avia_framework' ) . ' ';
  43.         $output .=  $cats;
  44.         $output .= '</span><span class="text-sep text-sep-cat">/</span>';
  45.     }
  46.  
  47.  
  48.     $output .= '<span class="blog-author minor-meta">' . __( 'by','avia_framework' ) . ' ';
  49.     $output .=  '<span class="entry-author-link" >';
  50.     $output .=      '<span class="vcard author"><span class="fn">';
  51.     $output .= get_the_author_posts_link();
  52.     $output .=      '</span></span>';
  53.     $output .=  '</span>';
  54.     $output .= '</span>';
  55.  
  56.     $output .= '</span>';
  57.     $output .= '</div>';
  58.     return $output;
  59. }
  60.  
  61. add_shortcode( 'post_meta_infos', 'enfold_post_meta_infos' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement