How to Add a Header Widget in WordPress

We can simply add the header widget to  WordPress website by modifying to pages in the website. For Adding header widget we need to modify the functions.php file and header.php file in the wordpress

Path for the files

function.php wp-content/themes/{theme name }/ function.php
header.php wp-content/themes/{theme name }/ header.php

Modifying the file

Step 1 : Add the below code to function.php it’s declaring the widget into our WordPress website header section

function wpb_widgets_init() {
register_sidebar( array(
'name' => 'Header Widget',
'id' => 'header-widget',
'before_widget' => '<div class="hw-widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="hw-title">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'wpb_widgets_init' );

Step 2 : Calling the declared widget in the theme.

<?php
if ( is_active_sidebar( 'header-widget' ) ) : ?>
    <div id="header-widget-area" class="hw-widget widget-area" role="complementary">
	<?php dynamic_sidebar( 'header-widget' ); ?>
    </div>
<?php endif; ?>

Modifying the Widget

Now you can modify the widget from the WordPress Dash Board
 
 

WordPress Visual Composer loading slowly

If your Visual Composer loading slowly this will be helpful to you to solve the issue, open your wp-config.php file. (You can find it at the root directory of your WordPress installation) using a text editor.
Now, paste the following codes:

define( 'AUTOSAVE_INTERVAL', 180 ); // Seconds

Just above of the /* That’s all, stop editing! Happy blogging. */ line.
If 180 not resolves, then add 240, 360 etc & check.
Hope this helps you

What is the basic difference between posts vs. Pages in WordPress ?

Posts and pages are the two content types used in WordPress. When WordPress is used as a blogging platform, majority of the content are posts. Posts are timed and are listed in chronological order with the latest posts on the top. The old posts are archived on the basis of month and year. Posts are meant to be shared and commented on.
Pages in WordPress, on the other hand, are static content that may include about us, contact us, privacy policies and others pages. The pages are timeless entries and do not have a date or month associated with them. For instance, even if you make changes to them, you will not have a Privacy policy page 2014 and Privacy policy page 2015 and so on. WordPress pages are not interactive and users do not share or comment on it.