Tagged: x
-
AuthorPosts
-
April 11, 2016 at 4:13 pm #877178
Cindy HParticipantI want to remove the following from the blog – meta data.
1) The word “IN”, and the commas between categories
2) The word “BY”, and the username
3) Remove the / and Date of postI want to MOVE the categories to below the “READ MORE”
Can anybody advise me on how to accomplish this?
Here is the screenshot of how I would like to have the final product look like.
April 11, 2016 at 4:17 pm #877185
Cindy HParticipantHere is the screen shot
April 12, 2016 at 2:44 am #877812
Paul RModeratorHi Cindy,
Thanks for writing in!
To achieve that, you can add this in your child theme’s functions.php file
function x_integrity_entry_meta() { // // Author. // $author = sprintf( '<span><i class="x-icon-pencil" data-x-icon=""></i> %s</span>', get_the_author() ); // // Date. // $date = sprintf( '<span><time class="entry-date" datetime="%1$s"><i class="x-icon-calendar" data-x-icon=""></i> %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 ) ) . '"><i class="x-icon-bookmark" data-x-icon=""></i> ' . $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 ) ) . '"><i class="x-icon-bookmark" data-x-icon=""></i> ' . $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() ); if ( $number == 0 ) { $text = __( 'Leave a Comment' , '__x__' ); } else if ( $number == 1 ) { $text = $number . ' ' . __( 'Comment' , '__x__' ); } else { $text = $number . ' ' . __( 'Comments' , '__x__' ); } $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments"><i class="x-icon-comments" data-x-icon=""></i> %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">%s</p>', $categories_list ); } }Then add this in custom > css in the customizer
.p-meta>span:after { display:none; } .p-meta>span>a { border-radius:5px; border:1px solid #777; padding:3px 5px; }Hope that helps.
April 12, 2016 at 6:14 am #878057
Cindy HParticipantThat’s perfect thanks! I can format the rest from here.
Is there a way to remove the comma’s between each category?
April 12, 2016 at 8:03 am #878224
John EzraMemberHi there,
Thanks for updating the thread! Yes it is, you can remove the comma separator from the code provided above on this line:
$separator = ', ';Hope this helps – thanks!
April 12, 2016 at 8:33 am #878278
Cindy HParticipantFANTASTIC! Thanks so much for the stellar support.
April 12, 2016 at 10:56 am #878532
Cindy HParticipantI have another question. Can I add it to this post or should I start a new thread?
I want to set a default max with of 688px to all items that are located in a single column
.x-column.x-1-1Right now I am using the css code
.x-column.x-1-1 {
max-width: 668px;
}However my text is completely justified to the left. I would like this 668px box to be centered in my page.
Is that possible?
I have used the following for my blog, but can’t seem to figure out how to accomplish that in regular content.
.single-post .x-container.max.width.offset {
max-width: 668px;
}April 12, 2016 at 5:25 pm #879028
FriechModeratorHi There,
Your page is in coming soon mode, would you mind providing us login credentials in private reply so we can take a closer look.
Thanks.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-877178 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
