Skip to content

Instantly share code, notes, and snippets.

@drdogbot7
Created October 19, 2017 23:21
Show Gist options
  • Save drdogbot7/2f97f933a3dc10d059b2a08a6dad786d to your computer and use it in GitHub Desktop.
Save drdogbot7/2f97f933a3dc10d059b2a08a6dad786d to your computer and use it in GitHub Desktop.
Wordpress Carbon Fields, Display Field on Home (Static)
add_action( 'carbon_fields_register_fields', 'crb_attach_home_options');
function crb_attach_home_options() {
Container::make( 'post_meta', 'Home' )
->where( 'post_id', '=', get_option( 'page_on_front' ) )
->add_fields( array(
Field::make( 'text', 'a_text_field' ),
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment