Tagged: x
-
AuthorPosts
-
October 6, 2016 at 11:56 pm #1206332
doohikeyParticipantMy 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!
October 7, 2016 at 12:37 am #1206353
RupokMemberHi 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: “%s”", '__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: “%s”", '__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: “%s”', '__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.
October 7, 2016 at 12:44 am #1206360
doohikeyParticipantAlso how to I change The Blog title or remove it??
October 7, 2016 at 12:59 am #1206371
RupokMemberHi there,
Thanks for writing back. Did that work for you? You can change the blog title from Customzie > Renew > Blog Options > Blog Title
Cheers!
October 7, 2016 at 5:18 am #1206555
doohikeyParticipantBlog title gone.
This still looks awkward.
October 3, 2016 / by Shari / 0 Comments
want it to read:
October 3, 2016 by Shari | 0 Comments
October 7, 2016 at 7:37 am #1206655
Paul RModeratorHi,
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: “%s”", '__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: “%s”", '__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: “%s”', '__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.
October 10, 2016 at 9:19 pm #1210823
doohikeyParticipantI’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
October 10, 2016 at 9:24 pm #1210825
doohikeyParticipantOn 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?
October 11, 2016 at 2:10 am #1211034
RupokMemberHi 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!
October 14, 2016 at 9:59 pm #1216943
doohikeyParticipantThis 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 CommentsIt’s not give a number for comments it’s a weird: %s
please fix your code.
October 15, 2016 at 2:45 am #1217113
ChristopherModeratorHi 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: “%s”", '__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: “%s”", '__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: “%s”', '__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: “%s”", '__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: “%s”", '__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: “%s”', '__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.
October 18, 2016 at 11:53 pm #1221828
doohikeyParticipantThat 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 CommentsWhere is says comment it reads: %s Comments
it should read:
52 Comments on this page:
October 19, 2016 at 3:09 am #1221970
ChristopherModeratorHi 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-1216943So 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.
October 20, 2016 at 12:37 am #1223379
doohikeyParticipantThis 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.
October 20, 2016 at 1:45 am #1223443
Rue NelModeratorHello 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 / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thank you.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1206332 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
