WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] hide category, by and comments (23 posts)

  1. floridawebguy
    Member
    Posted 1 year ago #

    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.

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    If you post a link to the site, someone can likely help you.

  3. floridawebguy
    Member
    Posted 1 year ago #

    Thanks again WPyogi.

    Web address is http://touchofred.net/

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Sorry if I'm being dumb, but which page does that show up on?

  5. floridawebguy
    Member
    Posted 1 year ago #

    I apologize - I have the page hidden for now. You can see it on JaredFinegold.com/blog.

    Thank you again!!!!!

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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;
    }
  7. floridawebguy
    Member
    Posted 1 year ago #

    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">&larr;</span> %title', 'gridiculous' ) ); ?></div>
    				<div class="next fr"><?php next_post_link( '%link', __( '%title <span class="meta-nav">&rarr;</span>', 'gridiculous' ) ); ?></div>
    			</nav><!-- #posts-pagination -->
    
    			<?php comments_template( '', true ); ?>
    
    		<?php endwhile; // end of the loop. ?>
    
    	</div><!-- #primary.c8 -->
    
    <?php get_footer(); ?>
  8. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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.

  9. floridawebguy
    Member
    Posted 1 year ago #

    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;
    }
  10. floridawebguy
    Member
    Posted 1 year ago #

    Hi WPyogi - I'm updating that in the child theme right? I've tried for the last bit and it hasn't worked :(

  11. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Looks like somehow your theme got switched back to the parent -- so you need to activate (switch to) the child theme.

  12. floridawebguy
    Member
    Posted 1 year ago #

    Amazing!

    Any idea how do hide the "by admin?"

    Is it ...

    .author-box a {
       display: none;
    }
  13. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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...

  14. floridawebguy
    Member
    Posted 1 year ago #

    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?

  15. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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 :).

  16. floridawebguy
    Member
    Posted 1 year ago #

    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

  17. floridawebguy
    Member
    Posted 1 year ago #

    I found the way to change "by admin" to "by my name" that issue is solved!!!!!

    Only thing left is showing titles on the singular post display for a blog.

    Again WPyogi, I owe you big time!

  18. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Hey, it looks like it's working fine with the titles -- make sure you've cleared your browser cache. I think the last code I posted worked as intended -- it has display none for all the pages, except the blog. Is that what you want?

    You're welcome...anytime, and thanks for your kind words too. And good for you for solving a lot yourself too.

  19. floridawebguy
    Member
    Posted 1 year ago #

    The posts are appearing on the blog home page - http://jaredfinegold.com/blog/

    If you click on the title from that page to view the post, the title disappears. http://jaredfinegold.com/day-1-blogging-day-2-training/

    What do we think the workaround is?

  20. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    You can add the single class to this:

    body.blog .post-title,
    body.single .post-title {
        display: block;
    }

    So that will cover any pages using the single.php template. Does that work?

  21. floridawebguy
    Member
    Posted 1 year ago #

    You're AMAZING!!!!!!!!! It worked perfectly. Do you have an email address or website? I'd love to keep in touch.

  22. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Sure...is that your personal site, I'm guessing? (If so, I'll email you?) Looks like you have a cool job?!

  23. floridawebguy
    Member
    Posted 1 year ago #

    Yup, shoot me an e-mail!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.