Tagged: x
-
AuthorPosts
-
March 23, 2016 at 1:54 pm #849917
Hi there
Hoping you guys can help as ever… is there any way of doing a global removal and date from all posts and portfolio items in Ethos please?
I’m a bit of a WordPress newbie, so if it involves a child theme, could you point me in the direction of how to create one?
Finally, is there an ideal size to upload to featured images on this theme? Some pics don’t seem to go full width of the page. Many thanks in advance
March 23, 2016 at 4:07 pm #850109Hello There,
Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
Thanks.
March 23, 2016 at 4:38 pm #850153This reply has been marked as private.March 23, 2016 at 7:14 pm #850360Hi James,
Thanks for the credentials, you can add this under Custom > CSS in the Customizer.
.p-meta span:first-child:after, .p-meta span:last-child { display: none; }
Images with 1200px in width will do.
Hope it helps, Cheers!
March 24, 2016 at 6:46 am #850939Hi there
Thanks for the speedy response but it doesnt seem to have worked.
It’s removed the date from the post only, the author name is still there. It also still has date/author metadata on the featured posts on the slider, carousel and blog entries
Cheers
JamesMarch 24, 2016 at 7:12 am #850954Hi James,
Please remove the code given above then add this in your child theme’s functions.php file.
function x_ethos_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>%1$s %2$s', __( 'In', '__x__' ), 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>%1$s %2$s', __( 'In', '__x__' ), 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">%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</p>', $categories_list, $comments ); } } function x_ethos_entry_cover( $location ) { if ( $location == 'main-content' ) { ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <a class="entry-cover" href="<?php the_permalink(); ?>" style="<?php echo x_ethos_entry_cover_background_image_style(); ?>"> <h2 class="h-entry-cover"><span><?php x_the_alternate_title(); ?></span></h2> </a> </article> <?php } elseif ( $location == 'post-carousel' ) { ?> <?php GLOBAL $post_carousel_entry_id; ?> <article <?php post_class(); ?>> <a class="entry-cover" href="<?php the_permalink(); ?>" style="<?php echo x_ethos_entry_cover_background_image_style(); ?>"> <h2 class="h-entry-cover"><span><?php ( $post_carousel_entry_id == get_the_ID() ) ? the_title() : x_the_alternate_title(); ?></span></h2> <div class="x-post-carousel-meta"> <span class="entry-cover-categories"><?php echo x_ethos_post_categories(); ?></span> </div> </a> </article> <?php } } function x_ethos_featured_index() { $entry_id = get_the_ID(); $index_featured_layout = get_post_meta( $entry_id, '_x_ethos_index_featured_post_layout', true ); $index_featured_size = get_post_meta( $entry_id, '_x_ethos_index_featured_post_size', true ); $index_featured_layout_class = ( $index_featured_layout == 'on' ) ? ' featured' : ''; $index_featured_size_class = ( $index_featured_layout == 'on' ) ? ' ' . strtolower( $index_featured_size ) : ''; $is_index_featured_layout = $index_featured_layout == 'on' && ! is_single(); ?> <a href="<?php the_permalink(); ?>" class="entry-thumb<?php echo $index_featured_layout_class; echo $index_featured_size_class; ?>" style="<?php echo x_ethos_entry_cover_background_image_style(); ?>"> <?php if ( $is_index_featured_layout ) : ?> <span class="featured-meta"><?php echo x_ethos_post_categories(); ?> </span> <h2 class="h-featured"><span><?php x_the_alternate_title(); ?></span></h2> <span class="featured-view"><?php _e( 'View Post', '__x__' ); ?></span> <?php else : ?> <span class="view"><?php _e( 'View Post', '__x__' ); ?></span> <?php endif; ?> </a> <?php }
Kindly add the code after this line
// Additional Functions
// =============================================================================Thanks
April 4, 2016 at 12:25 am #865414Hi Paul
Thanks again – that worked. Great support
best
JamesApril 4, 2016 at 3:48 am #865607You’re welcome.
-
AuthorPosts