Forums

How to hide date / time in individual post? (6 posts)

  1. presstime
    Member
    Posted 1 year ago #

    Hello.

    Is there a way to hide the date / timestamp in an individual post?

    Thanks.

  2. Erik
    Member
    Posted 1 year ago #

    What theme are you using?

    If there's a id/class assigned to just the date and time, you can easily hide it with display:none;.

    If you want it removed altogether, you'd probably want to create a child theme for whatever theme you're using, and make a new styles.css and posts.php file for the child theme, and remove it from the template entirely.

    Hard to say without knowing exactly what you want accomplished and what theme you're using.

  3. presstime
    Member
    Posted 1 year ago #

    Hi Erik and thanks for your reply.

    I'm using brownline. For some posts that don't change, I prefer not to show the date.

    Thanks.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    There are literally thousands of WordPress themes - which means that many people won't be familiar with your particular theme. So a link to your site where people can see the theme would be more helpful.

    However, if you want to hide post dates on an ad hoc basis but don't want to edit the theme's stylesheet every time to add a new post id, an alternative solution would be to use a custom field which could then be used, via the relative template files, to apply a class around the post dates that you want to hide. That way,you would only need to make a single addition to your theme's stylesheet but would have the option to hide or show post dates whenever you wanted via the Edit Post interface.

  5. presstime
    Member
    Posted 1 year ago #

    Thanks esmi.

    I'll give custom field a try.

  6. presstime
    Member
    Posted 1 year ago #

    UPDATE:

    I found the Function Reference therefore, I added a span tag around the timestamp using a class="timestamp-<?php the_ID(); ?>". That way, I can modify each post's CSS independently.

Topic Closed

This topic has been closed to new replies.

About this Topic