• Resolved dm98

    (@dm98)


    Firstly I’m adding a ‘Custom HTML’ block to my mega menu, then I’m adding an ACF text field to the menu edit page, after this I’m using the shortcode [acf field=”field_name”] in the custom HTML block to try to load data from the field below, when saved this is just giving an empty space where the content should be.

    Is there any reason why this isn’t working?

    I’ve tried several variations of the shortcode and ACF fields, I’ve successfully loaded other shortcodes in the custom HTML block for example [gallery] – Just for some reason my ACF fields won’t load.

    Thanks in advance for any assistance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi dm98,

    Have you tested the ACF shortcode you’re trying to use directly within the content of a page/post?

    Regards,
    Tom

    Thread Starter dm98

    (@dm98)

    Hi Tom,

    Thanks for your response.

    I ended up using a workaround. I found that ACF fields were working when situated on a page or post, then using the shortcode [acf field=”field_name” post_id=”123″] I could pull them in on the mega menu.

    I was unable to get them working when situated on a Menu page or Settings page, this could be an ACF issue though rather than an issue with this plugin. Perhaps the shortcode I was using was incorrect. I tried without defining a post_id (as I assumed with the field being on the menu page they wouldn’t need it), but also tried on settings pages using shortcodes like [acf field=”field_name” post_id=”theme_general_settings”] , etc.

    Maybe this will help someone in the future.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using ACF Shortcodes in menu custom HTML block’ is closed to new replies.