WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Fourteen
[resolved] remove date on comments page (5 posts)

  1. Trisha.Blogs
    Member
    Posted 8 months ago #

    I managed to remove date from post by using this code:

    .home .post .entry-date {
    display: none;
    }

    But when i click on "Leave a comment", the post (#respond) would show the date right at the top.

    Is there any way I can remove this date as well?

    thanks

  2. kaniamea
    Member
    Posted 8 months ago #

    If I understand correctly you would like to remove the date from the posts, but keep the date in the comment, correct?

    If so, make sure you have a child theme installed and this is the theme you modify. Then go to: inc/template-tags.php and find this section of code:

    // Set up and print post meta information.
    	printf( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>'

    and remove:

    <span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span>

  3. Trisha.Blogs
    Member
    Posted 8 months ago #

    Thanks kaniamea! This is exactly what I wanted.

    I have a little problem though. I got it to work only on the original theme and not on the child theme. Post date still exists for child theme.

    What I did for child theme was:
    I first created a directory "/inc" in my child theme directory.
    I edited original "template-tags.php" by removing what you mentioned above.
    I saved the file in my child theme folder/inc/.

    Is this the correct way of doing this? I'm still really new to child themes and would rather amend the file in child theme instead of the original file.

    Thanks again!

  4. kaniamea
    Member
    Posted 8 months ago #

    You did it correctly, Trisha.Blogs. But it seems there is no easy way to overwrite template-tags.php. So instead try adding this to your child style.css file:

    .entry-date {
    display: none;
    }

    You almost had it correct the first time you tried to do that :)

  5. Trisha.Blogs
    Member
    Posted 8 months ago #

    omg! thank you kaniamea! it worked like a charm! :) just amending the child style.css is good enough. thanks again :D

Reply

You must log in to post.

About this Theme

About this Topic