Support

Account

Home Forums Add-ons Flexible Content Field Hook into flexible content field from parent Theme?

Helping

Hook into flexible content field from parent Theme?

  • Hi! Is it possible to hook into a parent themes flexible content field from the child theme?

    Say I wanted to create a few extra custom layouts with a flexible content field in the child theme and then add them into the parent themes flexible content. If it’s possible, how do I do that?

  • I gave an example here for removing layouts https://support.advancedcustomfields.com/forums/topic/disable-layout-from-showing-in-template/

    To add layouts you would need to have the layouts saved in a JSON file or you would need to create them in PHP. You can then load this field group and append the layouts from the flex field to the flex field of the parent theme group.

    I’m really not sure how you could manage this because there will be no way for the parent theme to know what field group to merge layout from. This is probably something that would need to be coded into each child theme separately.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.