• I use the Local as my Localhost. I tried to create widget by this function in PHP and add Custom HTML, but I cannot write the Title, because this label doesn’t show up and It doesn’t display on my Website as the Html even I write heading it shows only plain text

    function custom_footer_widget_one() {
    	$args = array(
    		'id' 							=> 'footer-widget-col-one',
    		'name'						=> __('Footer Column One', 'text_domain'),
    		'description'			=> __('Column One', 'text_domain'),
    		'before_title'		=> '<h3 class="title">',
    		'after_title' 		=> '</h3>',
    		'before_widget'		=> '<div id="%1$s" class="widget %2$s">',
    		'after_widget'    => '</div>'
    	);
    	register_sidebar( $args );
    }
    add_action( 'widgets_init', 'custom_footer_widget_one');
    • This topic was modified 3 years, 6 months ago by rom6890.
Viewing 1 replies (of 1 total)
  • A registered sidebar needs to be called inside your theme. It’s not enough to simply declare it in the functions.php.

    To do so you need to add the following code wherever you want it to appear (page.php, single.php, archive.php and so on):

    <?php if ( is_active_sidebar( 'footer-widget-col-one' ) ) : ?>
        <?php dynamic_sidebar( 'footer-widget-col-one' ); ?>
    <?php endif; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Title label in Widget doesn’t show up’ is closed to new replies.