My way: Create a widget area in your header for some widgets not only Transposh.
Step 1
You have to add in function.php located in theme directory or in child theme create functtions.php:
/*
* Register Widget Area.
*
*/
function wpg_widgets_init() {
register_sidebar( array(
'name' => 'Header Sidebar',
'id' => 'header_sidebar',
'before_widget' => '<div id="wpg-widget">',
'after_widget' => '</div>',
'before_title' => '<h3 class="rounded">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'wpg_widgets_init' );
Place the widget area in header
Step 2
Modify header.php in theme directory or better in child theme directory and you have to add one line of code.
Not modified header.php:
...
<?php the_core_header_mobile_menu(); ?>
<?php the_core_header(); ?>
<div id="main" class="site-main">
The piece of code from my header.php
...
<?php the_core_header_mobile_menu(); ?>
<?php the_core_header(); ?>
<?php if ( !function_exists('dynamic_sidebar') || dynamic_sidebar('header_sidebar') ) : endif; ?>
<div id="main" class="site-main">
As you see this inserted line:
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('header_sidebar') ) :
endif; ?>
it is between the_core_header() and <div id=”main” class=”site-main”>.
Got to Appearance->Widget in WP Admin
Step 3
Find the new created widget area Header Sidebar and place there the Transposh widget inside (choose flags).
That’s it!