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.

Custom field date value , custom block template

  • So i used the AFC plugin to register custom post types and add custom fields and then used this method:

    https://generatepress.com/forums/topic/acf-block-in-dynamic-template-for-cpt/

    To create a block template and then use the post meta values to display the custom fields in the template

    Is there a way to when I use the date field in AFC to display it as a text value using the block template? Now it just displays numbers regardless of what date format I use .

    And if I use the URL field to display a link , is it possible to define the link to open in a new tap ?

    When I use the link field from AFC where I can define open in new tap and try to display it in the content template I get a php error , only URL works

    Thank you

  • Hi there,

    To return the selected date format, it requires the GB Pro plugin.

    GB free just simply returns the value.

  • I do have the GB pro plugin installed and activated and a licence, i just forgot to add the support key which i have done now.

    But it still does not work and just returns the value

  • That’s weird, can you provide an admin login to your site so we can take a look at the backend?

    Please also link us to where the date post meta is being used.

    Let me know 🙂

  • its in a headline element inside a container, i cant really provide login details because i develop the site on a local server.

    What could be a reason that it not works ?

  • What’s the field type? Is it Date picker?

    What’s the Return Format?

  • yes its a date picker and i tried all available forms but the return is always just the value like : 20190612 for example

  • This is a silly question, but is the GB Pro plugin activated?

    If so, can you disable all other plugins except GP Premium/GB/GB Pro/ACF to eliminate plugin conflicts?

    If you are using a child theme, try switching to the parent GP theme as well.

    Let me know 🙂

  • Yes the plugins are activated but i recently uploaded a copy of my site on a server to show it to someone and deactivated the licences on my local site and activated it on the online version . Then I put the licences keys again into my local version and deactivated them on the online version.

    Could this have caused this issue ?

  • Hi there,

    can i see the page where the date is being displayed incorrectly ?

  • unfortunately i cant because i have the site only on a local server, i could try to transfer the licences again and try replicate it on the live server version

  • Could i get some screenshots of the ACF Field settings and the dynamic data on the block ?

  • sure, here is the afc custom field and the dynamic data on the block, basically the date should be displayed next to publication date

    View post on imgur.com

  • Ah, ok.
    The Dynamic Data setting in the block toolbar are a GP Element option.
    Uncheck that, and instead go the Block Setting sidebar, and enable the Dynamic Data there, this will use GB / GB Pros method which supports ACF.

  • eastriverstudio

    Hi all

    Sorry to jump in here but I experienced this just recently. Zahaj are you using GB’s dynamic data otpions in the right panel or the original GP dynamic data which appears in the content tool bar of the block? I recently found in a block element that the date is not returned properly using GP’s dynamic data option, but if you use GB option in the right panel it correctly returns the format set in ACF.

    Hope this helps?

  • ok it works doing it that way, but is there a way with this method to add text before the dynamic data is displayed.

    Also is it possible to set links from custom fields to open in new tabs ?

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