Delete Date Header or Disabling

Hi!

I am very very new in the Markdown language.

Following the steps in this thread: https://discourse.getgrav.org/t/disabling-the-date-display-from-blog-post/4442 I can’t find the solution (I am a new user in this world). :flushed:

I am working with a skeleton, and on the item pages I cannot erase the publication date…

Within the page, in Options, I have the Date disabled, as you can see:

In the Grav cms Configuration options, I also have the Date option removed, as you can see here:

Then I have given Clean Cache, delete cookies, clear history, pass ccleaner… But I can’t get the date off.

Can someone please explain to me, what steps do I have to follow to erase the date?

It only appears on the ITEM page template…

Thanks for your attention :sweat_smile:

The easiest way is to switch it off via CSS:

.list-blog-date { display: none; }

1 Like

@montty,

You forgot to mention which skeleton/theme you are using. I presume you are using the Quark blog skeleton?

The CSS approach:
When using theme Quark, the following css snippet will ‘remove’ the date from a blog item:

.blog-date {
    display: none;
}

You could add this little css snippet to file ‘/user/themes/quark/css/custom.css’. It will work, but… As soon as you update Quark to a new version, your changes will be lost.
To prevent loosing changes, you should use an inherited theme.

Follow the following steps to use an inherited theme:

  1. Follow the documentation on Theme Inheritance, which will guide you step-by-step through the process of creating a child (inherited) theme.
    Note, you only need to run steps 1-5.
  2. In your child theme, create file ‘/user/themes/mytheme/css/custom.css’ and add your css snippet in that file.

The template override approach:
An alternative approach is to override the template of Quark in which the date is added to the page. This is a very common technique used in Grav when the layout/design of a page needs to be altered…

Use the following steps:

  1. If not already, you need to create an inherited theme. See above.
  2. Copy file ‘/user/themes/quark/templates/item.html.twig’ into folder ‘/user/themes/mytheme/templates’.
  3. Open file ‘/user/themes/mytheme/templates/item.html.twig’ and comment out or delete line 14 containing:
    {% include 'partials/blog/date.html.twig' %}
    

Whichever method you used, you should see the following header after refreshing the page.

image

Hope this helps…

1 Like

Thank you. It all worked! :wink: :clap:

@montty, Of course it all worked… :innocent:

Which approach have you taken to solve your issue? CSS or template override?

2 Likes

yes! already solved!