Support

Account

Home Forums Feature Requests Location keyword to represent get_option( 'page_on_front' )

Solved

Location keyword to represent get_option( 'page_on_front' )

  • I very often have at least one set of custom fields which are tied to the home page only. Unfortunately, these are tied to the front page’s IDs, and it’s possible that down the line a client could change which page is the front, for whatever bizarre reason they might have. This would remove the fields from the admin area.

    To make it more reliable, I usually create a new variable representing get_option( 'page_on_front' ); and set the location rules to it. But this will obviously not work with the ACF-JSON files which have been implemented in v5.

    To get around this, I propose a location keyword which represents whichever page is currently set as ‘page_on_front’. This will allow maximum portability whilst still allowing use of JSON

  • Hey @magnakai On my version of ACF5 you can add a “Page Type is equal to Front Page” rule. Is this not available for you?

  • Thank you, I feel very stupid for not noticing this before! That makes my life a lot easier.

  • This reply has been marked as private.
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Location keyword to represent get_option( 'page_on_front' )’ is closed to new replies.