Advertisement
Misplon

Don't display date for category ID 1

Oct 24th, 2019
155
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if ( ! function_exists( 'ultra_posted_on' ) ) :
  2. /**
  3.  * Prints HTML with meta information for the current post-date/time, author, comment count and categories.
  4.  */
  5.  
  6. function ultra_posted_on() {
  7.  
  8.     echo '<div class="entry-meta-inner">';
  9.  
  10.     if ( is_sticky() && is_home() && ! is_paged() ) {
  11.         echo '<span class="featured-post">' . esc_html__( 'Sticky', 'ultra' ) . '</span>';
  12.     }
  13.  
  14.     if ( ! in_category( '1' )  ) {
  15.         if ( is_home() && siteorigin_setting( 'blog_post_date' ) || is_archive() && siteorigin_setting( 'blog_post_date' ) || is_search() && siteorigin_setting( 'blog_post_date' ) ) {
  16.             echo '<span class="entry-date"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark"><time class="published" datetime="' . esc_attr( get_the_date( 'c' ) ) . '">' . esc_html( get_the_date( 'j F Y' ) ) . '</time><time class="updated" datetime="' . esc_attr( get_the_modified_date( 'c' ) ) . '">' . esc_html( get_the_modified_date() ) . '</time></span></a>';
  17.         }
  18.  
  19.         if ( is_single() && siteorigin_setting( 'blog_post_date' ) ) {
  20.             echo '<span class="entry-date"><time class="published" datetime="' . esc_attr( get_the_date( 'c' ) ) . '">' . esc_html( get_the_date( 'j F Y' ) ) . '</time><time class="updated" datetime="' . esc_attr( get_the_modified_date( 'c' ) ) . '">' . esc_html( get_the_modified_date() ) . '</time></span>';
  21.         }
  22.     }
  23.  
  24.     if ( siteorigin_setting( 'blog_post_author' ) ) {
  25.         echo '<span class="byline"><span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" rel="author">' . esc_html( get_the_author() ) . '</a></span></span>';
  26.     }
  27.  
  28.     if ( comments_open() && siteorigin_setting( 'blog_post_comment_count' ) ) {
  29.         echo '<span class="comments-link">';
  30.         comments_popup_link( esc_html__( 'Leave a comment', 'ultra' ), esc_html__( '1 Comment', 'ultra' ), esc_html__( '% Comments', 'ultra' ) );
  31.         echo '</span>';
  32.     }
  33.  
  34.     echo '</div>';
  35.  
  36.     if ( is_single() && siteorigin_setting( 'navigation_post_nav' ) ) {
  37.         the_post_navigation( $args = array( 'prev_text' => '', 'next_text' => '', ) );
  38.     }
  39. }
  40. endif;
Advertisement
RAW Paste Data Copied
Advertisement