Support

Account

Home Forums General Issues Using acf fields for content instead of WordPress editor

Helping

Using acf fields for content instead of WordPress editor

  • Hello, I hope everyone is doing well.

    I am using ACF on all of my pages for the content. This https://ibb.co/tqjz5x6 is how my homepage looks using ACF fields for the data. All these 5 sections contain some data e.g first section contains the top header image, the second one contains some repeater fields.

    I have section files for each section/component in ACF. For a background video section that looks like this https://ibb.co/Qvw7wSz, I have a section file named section-hero-video.php

    contents of page.php file
    @include('sections.section-hero-video')
    @include('sections.another-section')
    ......

    Some fields are shared across all the sections e.g. the title field. So, there should be a way to pass all the fields to each section file separately and load the sections into the page.php so it can load the correct sections for each page user wants to visit.

    If anyone has used acf fields for the content instead of WordPress editor or has done something similar, would you please share your opinion on how to go about this?

    Cheers.

  • It’s hard to say because I do not understand why you need to pass values or what type of fields you are using.

    The only suggestion I can give with the information provided so far is to use get_template_part() rather than PHP to include files.

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

You must be logged in to reply to this topic.