Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1206332
    doohikey
    Participant

    My blog meta tags read as this:

    Shari | October 3, 2016 | Blog Tours,Uncategorized, Wistful Winds | 0 Comments

    I would like it to read as:

    October 3, 2016 by Shari | 0 Comments

    Can you let me know how to change that?

    Thanks!

    #1206353
    Rupok
    Member

    Hi there,

    Thanks for writing in! In that case you will need template change with Child Theme. You can try the following within your Child Theme’s functions.php :

    // Entry Meta
    // =============================================================================
    
    if ( ! function_exists( 'x_renew_entry_meta' ) ) :
      function x_renew_entry_meta() {
    
        //
        // Author.
        //
    
        $author = sprintf( '<span>by %s</span>',
          get_the_author()
        );
    
        //
        // Date.
        //
    
        $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span>',
          esc_attr( get_the_date( 'c' ) ),
          esc_html( get_the_date() )
        );
    
        //
        // Categories.
        //
    
        if ( get_post_type() == 'x-portfolio' ) {
          if ( has_term( '', 'portfolio-category', NULL ) ) {
            $categories        = get_the_terms( get_the_ID(), 'portfolio-category' );
            $separator         = ', ';
            $categories_output = '';
            foreach ( $categories as $category ) {
              $categories_output .= '<a href="'
                                  . get_term_link( $category->slug, 'portfolio-category' )
                                  . '" title="'
                                  . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                  . '"> '
                                  . $category->name
                                  . '</a>'
                                  . $separator;
            }
    
            $categories_list = sprintf( '<span>%s</span>',
              trim( $categories_output, $separator )
            );
          } else {
            $categories_list = '';
          }
        } else {
          $categories        = get_the_category();
          $separator         = ', ';
          $categories_output = '';
          foreach ( $categories as $category ) {
            $categories_output .= '<a href="'
                                . get_category_link( $category->term_id )
                                . '" title="'
                                . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                . '">'
                                . $category->name
                                . '</a>'
                                . $separator;
          }
    
          $categories_list = sprintf( '<span>%s</span>',
            trim( $categories_output, $separator )
          );
        }
    
        //
        // Comments link.
        //
    
        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" class="meta-comments">%3$s</a></span>',
            esc_url( $link ),
            esc_attr( sprintf( __( 'Leave a comment on: &ldquo;%s&rdquo;', '__x__' ), $title ) ),
            $text
          );
    
        } else {
    
          $comments = '';
    
        }
    
        //
        // Output.
        //
    
        if ( x_does_not_need_entry_meta() ) {
          return;
        } else {
          printf( '<p class="p-meta">%1$s%2$s%3$s</p>',
            $date,
            $author,
            $comments
          );
        }
    
      }
    endif;

    Hope this helps.

    #1206360
    doohikey
    Participant

    Also how to I change The Blog title or remove it??

    #1206371
    Rupok
    Member

    Hi there,

    Thanks for writing back. Did that work for you? You can change the blog title from Customzie > Renew > Blog Options > Blog Title

    Cheers!

    #1206555
    doohikey
    Participant

    Blog title gone.

    This still looks awkward.

    October 3, 2016 / by Shari / 0 Comments

    want it to read:

    October 3, 2016 by Shari | 0 Comments

    #1206655
    Paul R
    Moderator

    Hi,

    Please change the code provided in #1206353 with this.

    
    // Entry Meta
    // =============================================================================
    
    if ( ! function_exists( 'x_renew_entry_meta' ) ) :
      function x_renew_entry_meta() {
    
        //
        // Author.
        //
    
        $author = sprintf( '<span>by %s</span>',
          get_the_author()
        );
    
        //
        // Date.
        //
    
        $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span>',
          esc_attr( get_the_date( 'c' ) ),
          esc_html( get_the_date() )
        );
    
        //
        // Categories.
        //
    
        if ( get_post_type() == 'x-portfolio' ) {
          if ( has_term( '', 'portfolio-category', NULL ) ) {
            $categories        = get_the_terms( get_the_ID(), 'portfolio-category' );
            $separator         = ', ';
            $categories_output = '';
            foreach ( $categories as $category ) {
              $categories_output .= '<a href="'
                                  . get_term_link( $category->slug, 'portfolio-category' )
                                  . '" title="'
                                  . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                  . '"> '
                                  . $category->name
                                  . '</a>'
                                  . $separator;
            }
    
            $categories_list = sprintf( '<span>%s</span>',
              trim( $categories_output, $separator )
            );
          } else {
            $categories_list = '';
          }
        } else {
          $categories        = get_the_category();
          $separator         = ', ';
          $categories_output = '';
          foreach ( $categories as $category ) {
            $categories_output .= '<a href="'
                                . get_category_link( $category->term_id )
                                . '" title="'
                                . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                . '">'
                                . $category->name
                                . '</a>'
                                . $separator;
          }
    
          $categories_list = sprintf( '<span>%s</span>',
            trim( $categories_output, $separator )
          );
        }
    
        //
        // Comments link.
        //
    
        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" class="meta-comments">%3$s</a></span>',
            esc_url( $link ),
            esc_attr( sprintf( __( 'Leave a comment on: &ldquo;%s&rdquo;', '__x__' ), $title ) ),
            $text
          );
    
        } else {
    
          $comments = '';
    
        }
    
        //
        // Output.
        //
    
        if ( x_does_not_need_entry_meta() ) {
          return;
        } else {
          printf( '<p class="p-meta">%1$s%2$s | %3$s</p>',
            $date,
            $author,
            $comments
          );
        }
    
      }
    endif;
    

    Then add this in your Custom > Edit Global CSS in the customizer.

    
    .p-meta>span:after {
        content: "";
    }
    

    Hope that helps.

    #1210823
    doohikey
    Participant

    I’m not trying to be picky, but it’s still has awkward space between:

    the date and author and there should be a space between that line and 1 like:

    | 1 comment

    #1210825
    doohikey
    Participant

    On this page i want it to have read: http://www.doohikeydesigns.com/blog/

    October 3, 2016 by Shari | Blog Tours, Uncategorized, Wistful Winds | %s Comment

    Also, why is my comments having that weird %s ? Shouldn’t it say the number of comments?

    #1211034
    Rupok
    Member

    Hi there,

    Let’s update the CSS code to following to get rid of the space :

    .p-meta > span::after {
      content: "";
      padding: 2px;
    }

    And please use the first code and update us so that we can provide you an alternative solution with CSS.

    Cheers!

    #1216943
    doohikey
    Participant

    This page:

    http://www.doohikeydesigns.com/blog/

    has a weird thing going on with comments.

    WISTFUL WINDS | THE INSPIRATION
    ShariOctober 14, 2016Blog Tours, Wistful Winds, Wistful Winds Blog Tour %s Comments

    It’s not give a number for comments it’s a weird: %s

    please fix your code.

    #1217113
    Christopher
    Moderator

    Hi there,

    If you want to disable categories on meta data, please update your code in functions.php to :

    // Entry Meta
    // =============================================================================
    
    if ( ! function_exists( 'x_renew_entry_meta' ) ) :
      function x_renew_entry_meta() {
    
        //
        // Author.
        //
    
        $author = sprintf( ' %1$s %2$s</span>',
          __( 'by', '__x__' ),
          get_the_author()
        );
    
        //
        // Date.
        //
    
        $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span>',
          esc_attr( get_the_date( 'c' ) ),
          esc_html( get_the_date() )
        );
    
        //
        // Categories.
        //
    
        if ( get_post_type() == 'x-portfolio' ) {
          if ( has_term( '', 'portfolio-category', NULL ) ) {
            $categories        = get_the_terms( get_the_ID(), 'portfolio-category' );
            $separator         = ', ';
            $categories_output = '';
            foreach ( $categories as $category ) {
              $categories_output .= '<a href="'
                                  . get_term_link( $category->slug, 'portfolio-category' )
                                  . '" title="'
                                  . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                  . '"> '
                                  . $category->name
                                  . '</a>'
                                  . $separator;
            }
    
            $categories_list = sprintf( '<span>%s</span>',
              trim( $categories_output, $separator )
            );
          } else {
            $categories_list = '';
          }
        } else {
          $categories        = get_the_category();
          $separator         = ', ';
          $categories_output = '';
          foreach ( $categories as $category ) {
            $categories_output .= '<a href="'
                                . get_category_link( $category->term_id )
                                . '" title="'
                                . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                . '">'
                                . $category->name
                                . '</a>'
                                . $separator;
          }
    
          $categories_list = sprintf( '<span>%s</span>',
            trim( $categories_output, $separator )
          );
        }
    
        //
        // Comments link.
        //
    
        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" class="meta-comments">%3$s</a></span>',
            esc_url( $link ),
            esc_attr( sprintf( __( 'Leave a comment on: &ldquo;%s&rdquo;', '__x__' ), $title ) ),
            $text
          );
    
        } else {
    
          $comments = '';
    
        }
    
        //
        // Output.
        //
    
        if ( x_does_not_need_entry_meta() ) {
          return;
        } else {
          printf( '<p class="p-meta">%1$s%2$s|%4$s</p>',
            
            $date,
            $author,
            $categories_list,
            $comments
          );
        }
    
      }
    endif;

    If you want to display categories, add following code :

    // Entry Meta
    // =============================================================================
    
    if ( ! function_exists( 'x_renew_entry_meta' ) ) :
      function x_renew_entry_meta() {
    
        //
        // Author.
        //
    
        $author = sprintf( ' %1$s %2$s</span>',
          __( 'by', '__x__' ),
          get_the_author()
        );
    
        //
        // Date.
        //
    
        $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span>',
          esc_attr( get_the_date( 'c' ) ),
          esc_html( get_the_date() )
        );
    
        //
        // Categories.
        //
    
        if ( get_post_type() == 'x-portfolio' ) {
          if ( has_term( '', 'portfolio-category', NULL ) ) {
            $categories        = get_the_terms( get_the_ID(), 'portfolio-category' );
            $separator         = ', ';
            $categories_output = '';
            foreach ( $categories as $category ) {
              $categories_output .= '<a href="'
                                  . get_term_link( $category->slug, 'portfolio-category' )
                                  . '" title="'
                                  . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                  . '"> '
                                  . $category->name
                                  . '</a>'
                                  . $separator;
            }
    
            $categories_list = sprintf( '<span>%s</span>',
              trim( $categories_output, $separator )
            );
          } else {
            $categories_list = '';
          }
        } else {
          $categories        = get_the_category();
          $separator         = ', ';
          $categories_output = '';
          foreach ( $categories as $category ) {
            $categories_output .= '<a href="'
                                . get_category_link( $category->term_id )
                                . '" title="'
                                . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                . '">'
                                . $category->name
                                . '</a>'
                                . $separator;
          }
    
          $categories_list = sprintf( '<span>%s</span>',
            trim( $categories_output, $separator )
          );
        }
    
        //
        // Comments link.
        //
    
        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" class="meta-comments">%3$s</a></span>',
            esc_url( $link ),
            esc_attr( sprintf( __( 'Leave a comment on: &ldquo;%s&rdquo;', '__x__' ), $title ) ),
            $text
          );
    
        } else {
    
          $comments = '';
    
        }
    
        //
        // Output.
        //
    
        if ( x_does_not_need_entry_meta() ) {
          return;
        } else {
          printf( '<p class="p-meta">%1$s%2$s|%3$s|%4$s</p>',
            
            $date,
            $author,
            $categories_list,
            $comments
          );
        }
    
      }
    endif;

    Hope it helps.

    #1221828
    doohikey
    Participant

    That is not what I’m asking. The Comments on my blog page has some freaking weird display. It’s not showing the number of comments. Are you not reading what I want?

    WISTFUL WINDS | THE INSPIRATION
    ShariOctober 14, 2016Blog Tours, Wistful Winds, Wistful Winds Blog Tour %s Comments

    Where is says comment it reads: %s Comments

    it should read:

    52 Comments on this page:

    http://www.doohikeydesigns.com/blog/

    #1221970
    Christopher
    Moderator

    Hi there,

    Did you try the code I provided in previous replay?

    I see that you want two different formats, see your previous replies :

    https://community.theme.co/forums/topic/meta-tags-2/#post-1206555
    https://community.theme.co/forums/topic/meta-tags-2/#post-1216943

    So I tried to fix %scomment issue while giving you option to display or hide categories.

    If you’ve already tried provided code but still need further assist, please provide us with login and FTP credentials.

    Thanks.

    #1223379
    doohikey
    Participant

    This is still not fixed on the blog page. It’s not on the post pages. It’s on the blog page where it shows multiple columns of blog entries.

    http://www.doohikeydesigns.com/blog/

    #1223443
    Rue Nel
    Moderator

    Hello There,

    Would you mind providing us the url of your site with login credentials so we can take a closer look and fix the issue?

    To do this, you can make a post with the following info:
    – Link to your site

    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thank you.

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