Meta Box
Support Forum
Support › MB Settings Page › Site Title as a custom field
Hi, anyway that I could change the WordPress site title with a custom field? Thank you.
Hi Will,
You can use the filter hook pre_get_document_title to change the site title. For example:
pre_get_document_title
function change_site_title( $title ) { $field_value = rwmb_meta( 'field_id', ['object_type' => 'setting'], 'option_name' ); $title = $field_value . ' - ' . get_bloginfo('name'); return $title; } add_filter( 'pre_get_document_title', 'change_site_title', 9999 );
Refer to the documentation https://developer.wordpress.org/reference/hooks/pre_get_document_title/ https://docs.metabox.io/extensions/mb-settings-page/#getting-field-value