• Hello, my Client is asking for this:

    Show “news” on homepage, but HIDE the whole news section if the news / blog posts are older than 30 days.

    This way it only shows the whole news section if there are actual news not older than 30 days. If news are older than 30 days, no news section is shown.

    Is something like this possible?

    Thank you!
    Florian, florian@hofmann.me

Viewing 1 replies (of 1 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    No, this is not possible. Timed Content only works as a shortcode within a post or page to show or hide content based on an absolute date value. There is no dynamic rule like “show only if posts in category X exists and are not older than 30 days”.

    What your client wants would be a custom page template (or shortcode or Gutenberg block – depending on what is needed exactly) which does a query for the news posts and either runs an output loop for that or hides the block completely.

    Also see https://developer.wordpress.org/reference/classes/wp_query/

Viewing 1 replies (of 1 total)
  • The topic ‘Using this to hide blog posts x days after publishing?’ is closed to new replies.