hide category, by and comments
-
On the posts page of my website, how do I hide the category, by ____ and X comments? I would like to leave the posting date.
-
If you post a link to the site, someone can likely help you.
Thanks again WPyogi.
Web address is https://touchofred.net/
Sorry if I’m being dumb, but which page does that show up on?
I apologize – I have the page hidden for now. You can see it on JaredFinegold.com/blog.
Thank you again!!!!!
No problem – so long as I’m not totally losing my mind — LOL!
Looks like the date can’t easily be separated in the CSS code, so if you want that to show up, you’ll need to modify the template used for that page. If you post that code to a pastebin, someone can likely help you with it. Then you’ll want to put the modified copy of that file in your child theme…
For the category, you can use this:
.post-category a { display: none; }
I’m very new to this, so hopefully this is what you’re looking for. Here is the code of “Single Post” (single.php).
If I add what you gave me above into my child theme, that will hide the category?
Thanks again WPyogi.
<?php get_header(); ?> <div id="primary" <?php gridiculous_primary_attr(); ?>> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'single' ); ?> <nav id="posts-pagination"> <h3 class="assistive-text"><?php _e( 'Post navigation', 'gridiculous' ); ?></h3> <div class="previous fl"><?php previous_post_link( '%link', __( '<span class="meta-nav">←</span> %title', 'gridiculous' ) ); ?></div> <div class="next fr"><?php next_post_link( '%link', __( '%title <span class="meta-nav">→</span>', 'gridiculous' ) ); ?></div> </nav><!-- #posts-pagination --> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #primary.c8 --> <?php get_footer(); ?>
Unfortunately, I have to run off for a while (going to get an Xmas tree!), but if someone else doesn’t pick this up, I’ll pick it back up when I get back — a couple of hours, probably…
And yes, the code I gave you should hide the category.
Have fun Xmas tree shopping.
And unfortunately that didn’t work.
I added the following to my child theme and it is still there.
/* Theme Name: Gridiculous Description: Child theme for style.css Author: Jared Template: gridiculous */ @import url("../gridiculous/style.css"); .post-title { display: none; } .post-category a { display: none; }
Hi WPyogi – I’m updating that in the child theme right? I’ve tried for the last bit and it hasn’t worked ??
Looks like somehow your theme got switched back to the parent — so you need to activate (switch to) the child theme.
Amazing!
Any idea how do hide the “by admin?”
Is it …
.author-box a { display: none; }
No, that’s a good, logical guess, but unfortunately that line of text is all coded under one CSS class – so you can remove the entire line by using this:
.post-meta { display: none; }
But that hides the date as well. That’s why I need to look at the php code – I’m really not that good with php, but I’ll see what I can figure out…
BTW – Hope Xmas tree shopping was fun!!!!!!!!!!
I figured out how to remove the comments! That was an easy toggle switch. It’s just the “by admin” that I’d like to see gone.
I have another question for you too … As you know, we created the child theme to hide all page titles on my site, and it worked. I just added a new page to start adding posts so I can blog. All of the post titles are now hidden too. Is there an easy work around to re-enable these?
Yeah, my mom and I had a good time getting a nice tree. Even better we got in into the stand and perfectly vertical on the first try — LOL! It’s outside now — but we’ll likely bring it in the house and decorate it next weekend. We’re pretty low key on all the holiday stuff, but having a tree is nice.
Okay, this should put the titles back on the blog page:
body.blog .post-title { display: block; }
I’m still working on the date question :).
You’re a Xmas angel – I REALLY REALLY REALLY appreciate all of your time and help.
Another question about the blog title. on the /blog page, the title is there. The title is currently clickable taking you to the full post. On that page, it disappears. Any easy work around?
The other thing I tried (unsuccessfully) was changing `.post-title {
display: none;
}
`
to be specific for each post ID with
.page-id-1826 .entry-title {display: none;}
Maybe I just had the wrong code though?
Biography page-id-12
Contact page-id-16
Vitae page-id-14
Tesitmonals page-id-2
Specialities page-id-17
Home page-id-107
Fun facts page-id-185
- The topic ‘hide category, by and comments’ is closed to new replies.