Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Removing “Last updated”

  • philipperoussel

    Hi,

    Below the title of my posts is the mention “Last Updated” followed by the date (see, for instance, https://onehomeplanet.com/the-politics-of-superpower-managed-democracy/). I could not access the old forum archive; can you remind me how we set this up? I’d like to remove this mention for a specific post category.

    Thanks for your help,

    Philippe

  • Hi Philippe,

    The option is in the customizer: https://docs.generatepress.com/article/blog-content-layout/#single

    However, that is a global option which will apply to all posts.

    If you want to disable it for a specific category only, try this PHP snippet:

    add_filter( 'option_generate_blog_settings', 'lh_remove_category_date' );
    function lh_remove_category_date( $options ) {
    
        if ( is_category ( '123' ) ) {
    	$options['single_date'] = false;
        }
      
        return $options;
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Please replace 123 with the actual ID of the category you would like the snippet to apply to.

    Reference: https://codex.wordpress.org/Conditional_Tags#A_Category_Page

    Let me know if this helps 🙂

  • philipperoussel

    Hi Leo,

    It does not work. Is there any way to access the old forum archive? We could start from when the “Last updated” mention was first implemented.

    Thank you.

  • philipperoussel

    Here is the CSS I have. For some reason, the “Last Updated” mention does not appear anymore when I create a new post, but only the date of the last modification. How do I make it reappear?

    Thank you.

  • philipperoussel

    .posted-on .updated {
    display: inline-block;
    }

    .posted-on .updated + .entry-date {
    display: none;
    }
    .posted-on .updated:before {
    content: “Last Updated “;
    }

  • If you want to remove “last updated”, just need to remove this CSS:

    .posted-on .updated:before {
    content: "Last Updated ";
    }
  • philipperoussel

    Hi,

    1/ I want to have the “Last Updated” mention appear. Even though the following CSS is in place, it does not.

    .posted-on .updated:before {
    content: “Last Updated “;
    }

    2/ I want the whole “Last Updated” with the date not to appear on one single post category.

    Thanks for your help.

  • 1/ I want to have the “Last Updated” mention appear. Even though the following CSS is in place, it does not.

    Which specific category do you mean? Do you mean the category archive or the single posts of that category?

    If it’s the single posts that you linked, then try changing that CSS to this:

    :not(.category-democracry-incoporated) .posted-on .updated:before {
        content: "Last Updated ";
    }

    Let me know if this helps!

  • philipperoussel

    Hi,

    I want to have the “Last Updated” mention appear on all single posts (not archive).

    Once this works, we’ll see how to remove this mention from a specific post category.

  • Hi there,

    1. go to Customizer > additional CSS and delete this:

    
    .posted-on .updated:before {
            content: "Last Updated "
        }
    
    

    2. Add this CSS:

    
    .single-post article:not(.category-democracry-incoporated) .posted-on .updated:before {
        content: "Last Updated ";
    }
    

    In the CSS selector you will see: article:not(.category-democracry-incoporated)

    change the .category-democracry-incoporated to the category you want to exclude the Last Updated text from

  • philipperoussel

    Hi David,

    You have answered my second question, which is great, but I also need an answer to the first one: How do I make the “Last Updated” mention appear on any and all posts?

  • appear on any and all posts

    Just the Single Posts ? And NOT the archives ?

  • philipperoussel

    Hi,

    With or without the archives. I do not know.

    Why does it matter?

  • In your original post, is that your site?
    https://app.screencast.com/zHXtFkwSht0Ox

    If so, the last updated text is showing, I’m not sure what you mean by your first question, as the text is already showing correctly.

  • philipperoussel

    The “Last Updated” mention appears on old posts, not on new ones I want to create.

    https://app.screencast.com/Zxw2bpmzVGm4b?tab=Details&conversation=lmz2QyBALNSqrCVHMmJL6s

  • The last updated text only appears if the post has been updated, your new post does not have an updated date, of course it won’t show.

    So your goal is to show the last updated on all posts no matter it’s been updated or not?

Viewing 16 posts - 1 through 16 (of 26 total)
  • You must be logged in to reply to this topic.