Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1240668
    Errrwin
    Participant

    Hi!

    Is it possible to add a links to comments as per the attached screenshot?

    
    TITLE
    date | comments

    If so: how? 🙂

    #1240749
    Thai
    Moderator

    Hi There,

    Please add the following code under functions.php file locates in your child theme:

    function x_icon_entry_meta() {
    
      if ( comments_open() ) {
    
        $title  = apply_filters( 'x_entry_meta_comments_title', get_the_title() );
        $link   = apply_filters( 'x_entry_meta_comments_link', get_comments_link() );
        $number = apply_filters( 'x_entry_meta_comments_number', get_comments_number() );
    
        $text = ( 0 === $number ) ? 'Leave a Comment' : sprintf( _n( '%s Comment', '%s Comments', $number, '__x__' ), $number );
    
        $comments = sprintf( '<span><a href="%1$s" title="%2$s">%3$s</a></span>',
          esc_url( $link ),
          esc_attr( sprintf( __( 'Leave a comment on: &ldquo;%s&rdquo;', '__x__' ), $title ) ),
          $text
        );
    
      } else {
    
        $comments = '';
    
      }    
    
      $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time> | '.$comments.'</span>',
        esc_attr( get_the_date( 'c' ) ),
        esc_html( get_the_date() )
      );
    
      if ( x_does_not_need_entry_meta() ) {
        return;
      } else {
        printf( '<p class="p-meta">%s</p>',
          $date
        );
      }
    
    }

    Then add the following CSS under Customizer > Custom > Global CSS:

    a.meta-comments {
        display: none;
    }

    Hope it helps 🙂

  • <script> jQuery(function($){ $("#no-reply-1240668 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>