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.

ACF & PDF Download

  • Hi there,

    is there a step-by-step manual on how to use ACF to add downloadable PDFs to a blog post hero?

    My idea is, that an individual pdf can be added to each blog post. The download link to the pdf
    should appear in the hero of a blog post.

    Can you help?

    Thanks in advance!

  • Hi there,

    In your ACF Field Group settings, create a custom File field and assign it to Posts (if you haven’t already).

    To add the download link in the Hero section, edit your Page Hero Element and add a GB Button block.
    Under the Link Destination field, insert this dynamic tag: {{post_meta key:pdf_file}}. Replace pdf_file with your actual ACF field name.

    Also, ensure that GenerateBlocks Pro is installed and activated for this to work.

    Let me know if you have further questions.

  • Thanks Alvind.

    Just to clarify.

    Is this – screenshot – the correct setup for the pdf_download field? Do I need to select “url” or “file“?

    When I use “url” as the field type, I can enter a url, but the button in the front end is then named after the url which isn’t what I want. The link works, but I would need to change the button name to PDF Download or something similar. How can I do that?
    I added a screenshot to the private info box.

    And is this – screenshot – the correct setup for the dynamic data you described?

    Does this only work with a button block or does it also work with hyperlinks?

    Podcast Episodes:
    Would it also be possible to create a “play-button” to start Podcast episodes which are fed via a dynamic ACF field? Who would I go forward aiming for this?

    Last not least – YouTube
    Would this also work with youtube videos which would appear in the hero section of a blog post when some one fills out the acf youtube url in the blog post?

    Thanks again for your great help!

    I appreciate it.

  • Is this – screenshot – the correct setup for the pdf_download field? Do I need to select “url” or “file“?

    If the PDF will be hosted in your media library, it’s best to use the File field type in ACF.
    Set the Return Value to File Array, so you can access both the file name and URL like this:

    
    {{post_meta key:pdf_download.filename}}
    {{post_meta key:pdf_download.url}}
    

    And is this – screenshot – the correct setup for the dynamic data you described?

    As for the dynamic data setup — yes, that looks correct.

    Regarding the podcast episodes — does the play button link to a video?

    If you’re embedding a YouTube video, you can use the oEmbed field type. This allows you to pull the video dynamically using the tag, and it will automatically embed the player.

  • Thanks Alvind,

    but how do I influence the CTA on the Download Button?
    As for now, the button shows the words which I entered in the post meta key.

    Any ideas?

  • You can type static text as the button text, and only add a dynamic link to it {{post_meta key:pdf_download.url}}.

  • Thanks Ying,

    that worked.

    I set the border colour of the button to black and the background colour to “none”.
    Still the button shows a blue border.

    Although I set the hover typo colour to white, it still shows as blue.

    Why’s that?

    I add the website link to the private info box.

    Thanks in advance!

  • Can you go to customizer > colors > content, and remove the link color you set there?

    Let me know if this helps!

  • Thanks Ying,

    yes – that worked perfectly!

    Enjoy the day.

  • You are welcome   🙂

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