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.

Adding custom field value Time adds seconds

  • I already had contact about this with the makers of the ACF plugin.

    When I add a time field ‘start’ with format H:i and add value 13.00 inside a post, and using the dymamic post meta value inside a GP Element, it will return the seconds too: 13.00:00 instead of just 13:00.

    When I disable the GP Premium plugin and just use the shortcode [acf field=”start”] in a post, the value is correct and only shows 13:00, without the seconds.

    I tested this with the default WP theme and with the default GP theme and all other plugins disabled.

  • Hi there,

    in the ACF Field, there is the Display Format and the Return Format, are both of those set to H:i ?

  • Yes, both are set to H:i.

  • What is also strange is that the output of the shortcode [acf field=”start”] inside the post is not visible, only when deactiving GP Premium.

    So when I use GP Premium it returns 13:00:00 and the output of the shortcode is not visible in the post content, and when I deactivate GP Premium the output of the value through the Element obviously is not there, but then the shortcode in the post content is (correctly) present, showing 13:00

  • Ok, i done some tests and it seems to be an issue with the GP Dynamic Data.

    Options:

    1. Do not use the GP Dynamic Data options, this “system” will be deprecated in the future anyway.
    Instead uset the Headline Block -> block settings –> Dynamic Data

    2. Use the Shortcode in the Element. The GB Headline blocks support shortcodes, so you can still add styles to it using the block settings.

  • Hi David,

    I first was doing this, so that didn’t work:

    dynamic data

    Always confused between those 2 dynamic options 😉 Using the dynamic data in the panel under Block settings returns the same 13:00:00, but pasting the shortcode right into the Headline block itself does indeed correctly returns 13:00. But the same shortcode inside the post is then gone. It seems that – except for correctly showing the output of the field – the ACF shortcode only works inside the post content with GP Premium disabled. But for now I can use option 2. Thanks.

  • The GP Dynamic Data was built as part of the Block Element, and this was before we added dynamic data to GB. But now GB has it, we will deprecate the GP one later.

    Did you disable the GP Dynamic Data option when you tried the GB one ?

    As the GB one works for me.

  • Yes. So I know have the shortcode in the Heading Block in the Element which will be show at the right of the post title, plus for testing purposes I also have that same code in the post content. But that one is not visible as long as I have GP Premium activated.

    dyn

    post

  • I ran some tests and this method worked for me:

    2023-04-17_14-22-09

  • It worked for me too, but then it shows the seconds again while the format is H:i. It seems the only thing that works for me is pasting the shortcode right inside the Heading block to get rid of those seconds.

  • Thats odd. as for me it doesn’t display the seconds…. i assume you’re ok with using the shortcode ?

  • Odd indeed, because I’m only using the GP theme and three plugins: Generate Blocks (free), GP Premium and the ACF plugin. For my purpose I can use the shortcodes inside the Heading block.

    By the way, when this method will be removed and only the dynamic data options in the side panel are present in GP, will websites still work that have been built with using the Dynamic options in the Heading blocks? Good to know because I used it a lot.

  • I’ll do some testing.

    will websites still work that have been built with using the Dynamic options in the Heading blocks?

    Yes, any site that uses the GP Dynamic Data, will continue to work.
    You just won’t see the option on new things you build.

  • Okay, thanks 🙂

  • You’re welcome

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