How to add custom classes to a WordPress theme HTML tag?

There is no designated template tag for classes on html container. For example in latest core Twenty Seventeen theme they are hardcoded: <html <?php language_attributes(); ?> class=”no-js no-svg”> For proper customization you would likely need to create a child theme and override repsective template (likely header.php) or settle on manipulating classes with JavaScript.

Child Theme – Changing Header

Not sure I fully understand what you’re trying to achieve, but can you make a check on the value of your custom field? Something like this: if( $field == ‘banner’ ) { // Display banner } You can put the code straight into your parent theme’s header-main.php and it will only execute if the value … Read more

Combine Categories & Custom Taxonomy

For following post type and taxonomy: /** * Register restaurant post type */ function wpse_287682_register_restaurant_post_type() { $labels = array( ‘name’ => __( ‘Restaurants’ ), ‘singular_name’ => __( ‘Restaurant’ ), ‘add_new’ => __( ‘Add new’ ), ‘add_new_item’ => __( ‘Add new’ ), ‘edit_item’ => __( ‘Edit’ ), ‘new_item’ => __( ‘New’ ), ‘view_item’ => __( ‘View’ … Read more