WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove date from pages only. (8 posts)

  1. Corweb
    Member
    Posted 2 years ago #

    Hi forum,

    I'm trying to remove the date from the pages of my website, but I would like to keep the date, tags, ... on my post overview page and single post.

    I'm using the Constructor theme.
    This is the website: http://www.cs-computers.be/new

    I'm looking in the page.php and I tried it by removing the code
    <?php if (get_constructor_option('content', 'date')) { the_date(); echo ' | '; } ?>

    Now, the date is removed from the pages and stays on the single posts.
    But it also disapears on the post overview page, which is called "Nieuws" on the website.

    Is there a way to keep the date on that post overview page?

    Thank you very much in advance code-wizards!

  2. Peter Wooster
    Member
    Posted 2 years ago #

    You might look at using CSS display:none based on the class you will find on the body element.

  3. Corweb
    Member
    Posted 2 years ago #

    Thanks @pkwooster.

    Still struggling. I can add display:none; to "article footer", but then it will disappear on all pages. Also on the post overview page and single post.

    I will try to find a solution.

    If in the meantime anyone can help me, it would be very much appreciated!

  4. deepbevel
    Member
    Posted 2 years ago #

    Is the posts overview page your blog page? odd that it would reference code on page.php. that should have no effect on your main posts loop. confusing.

  5. Corweb
    Member
    Posted 2 years ago #

    In reading settings in the dashboard I set it as follow:
    Front page displays: static page
    Front page: home
    post page: nieuws

    I've been trying to find a way to change the css as pkwooster wrote and I think I've found the/a solution.

    I used this code

    body.page-id-10 article footer {
    display:none;
    }

    And that removed the date etc, from the homepage. Now I'll add the other page-id's to css.

  6. deepbevel
    Member
    Posted 2 years ago #

    yep, that should let you show the date on selected pages only, nice work!

  7. Corweb
    Member
    Posted 2 years ago #

    OK, adding a display:none for every page-id I wanted to exclude worked!
    Thanks!

  8. deepbevel
    Member
    Posted 2 years ago #

    display none if my favorite tool:)

Topic Closed

This topic has been closed to new replies.

About this Topic