Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try this:

    in your header replace your code by this:

    <?php if ( is_active_sidebar( 'sidebar-my-widget' ) ) : ?>
    <?php dynamic_sidebar( 'sidebar-my-widget' ); ?>
    <?php endif; ?>
    
    and in your function replace your code by this:
    
    add_action( 'widgets_init', 'theme_slug_widgets_init' );
    function theme_slug_widgets_init() {
        register_sidebar( array(
            'name' => __( 'My Widget', 'theme-slug' ),
            'id' => 'sidebar-my-widget',
            'before_widget' => '<div class = "My Widget">',
    	'after_widget'  => '</div>',
    	'before_title'  => '<h3>',
    	'after_title'   => '</h3>',
        ) );
    }

    good luck!

    • This reply was modified 7 years, 1 month ago by bcworkz. Reason: code fixed, otherwise syntax errors occur

    Type in fields Scripts in header or Scripts in footer for example like this:
    <style>
    your style here
    </style>
    <script type=”text/javascript”>
    your js here
    </script>
    ….
    and make save.

Viewing 2 replies - 1 through 2 (of 2 total)