Support

Account

Home Forums General Issues unique content from fields on pages

Solved

unique content from fields on pages

  • Hi,

    I may be using the set up incorrectly here, so would like a little guidance on how to do this.

    At the moment, I have set up just 1 field in the backend, that will display on each page for editing. I need that field to be unique to that page, but with the same name in the backend – does that make sense?

    Inside the template, I have simply got:

    
    <?php
    $value = get_field( "secondary_content" );
    echo $value;
    ?> 
    

    I’m using the same template for a few pages, but the content itself needs to be different on each page.

    Like I say, I’m probably using it wrong, rather than a bug or an issue. Can anyone help point me in the right direction please? I can’t see anywhere in the backend of making the field’s content unique to the page.

    It’s essentially adding another wysiwig, or a simple textarea, onto each page in addition to the standard WordPress editor.

    Thanks.

  • Hi
    Your implementation should be just fine.

    ACF stores a field value per post id.

    This means that every page will have its own value which can be displayed using the same template file.

    The only thing you may need is to set the field location such as to show when post type == page

    I hope this helps

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

The topic ‘unique content from fields on pages’ is closed to new replies.