Removing tags from bottom of each post
-
Hi, I want to keep my tags from showing under each post, specifically remove “This entry was tagged x,x,x”
I don’t want to delete the rest of the sentence about it being posted in [category] on [date]. I’m using the twenty twelve theme and my website is http://www.mahsatousi.com
Thank you!
-
Hey there mahsa7,
This will require editing a line functions.php. I highly suggest creating a child theme and inserting the changed function into the child theme functions.php. This is the code you should paste into your child theme functions.php:
<?php if ( ! function_exists( 'twentytwelve_entry_meta' ) ) : /** * Set up post entry meta. * * Prints HTML with meta information for current post: categories, tags, permalink, author, and date. * * Create your own twentytwelve_entry_meta() to override in a child theme. * * @since Twenty Twelve 1.0 */ function twentytwelve_entry_meta() { // Translators: used between list items, there is a space after the comma. $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) ); // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) ); $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ), get_the_author() ); // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name. if ( $tag_list ) { $utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' ); } elseif ( $categories_list ) { $utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' ); } else { $utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' ); } printf( $utility_text, $categories_list, $tag_list, $date, $author ); } endif; ?>
This should remove the tags part being displayed under your posts.
Best regards,
BojanHi Bojan,
Thank you for the reply, I’m going to study the link to creating a child theme you sent and create one. I have some HTML knowledge but not good with CSS. I will let you know if I run into any trouble or have questions.
Thanks again!
MahsaHi Bojan,
I created the child theme and the style.css and functions.php, however in my dashboard under appearance and themes, I don’t see the child theme so that I can activate it. Please advise.
Mahsa
HELP!
I put the child theme under the correct folder (it’s subfolder under twentytwelve) and activated it and now my entire site is gone!
I can’t even login to wordpress:
http://www.mahsatousi.com/wp-admin/what happened? how do i fix it?
If you scroll to the very bottom of the “Themes” screen, do you see the text “Broken Themes”? If so, post the entirety of the text that appears.
If not, what folder are your child theme’s
style.css
andfunctions.php
in? They should be in a folder likewp-content/themes/twentytwelve-child
or something similar.I deleted the child theme and my site is back. Somewhere I did something wrong.
Ah, I just saw your latest post. The child theme should be in its own folder in
wp-content/themes
, not a folder within the parent theme’s folder. You should try to access your site via cPanel or whatever similar software your host provides and move the child theme’s folder from the parent theme’s folder towp-content/themes
.Your parent theme’s stylesheet isn’t being loaded at all. Can you post your child theme’s
functions.php
to Pastebin and post the link here?It seems to have stripped all other formatting from the original twenty twelve theme.
Just pasted it there.
I just realized I forgot to add this to the top, but my site is not working, I may have to delete and redo the child theme:
<?phpadd_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_theme_style’ );
function enqueue_parent_theme_style() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
}You know what, I keep creating the child theme folder under wp-content/themes, but bluehost keeps moving it as a subfolder under twenty twelve – i think that may be the problem.
Yeah, I’d advise speaking directly to Bluehost about that. In the meantime, though, you can copy and paste the code from this Pastebin into your child theme’s
functions.php
and it should work:Thanks, Stephen, that worked in removing the tags, but when I activate the child theme (fixed the subfolder problem), my header on my site disappears.
- The topic ‘Removing tags from bottom of each post’ is closed to new replies.