• Hi All,

    I have a 2011 theme v3.3 and a child theme. The child theme is active. Each time the 2011 theme is updated I lose the row of books on the homepage. See image https://pasteboard.co/Je9qaRf.jpg.

    The row of books is a custom widgetized space built with SiteOrigin pagebuilder modules. This code was placed into the parent 2011 theme.

    I’d like to be able to update the parent theme without losing that widgetized area. However, I am not sure if I made the child theme correctly.

    Any pointers on where to look or things to consider would be helpful.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • This code was placed into the parent 2011 theme

    into which file exactly? can you post the full code?

    Thread Starter Pcosta88

    (@pcosta88)

    @alchymyth

    Sure!

    It was placed into the parent themes function.php file to create the widget. See image: https://pasteboard.co/Jf2BXl7.jpg

    Code

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

    This then creates the widget (see image: https://pasteboard.co/Jf2CiZ3.png that I use site origin to built out that row of books beneath the menu: https://rickdestefanis.com/.

    The placement of the widget code to display goes into the parent themes header.php file. See image: https://pasteboard.co/Jf2DDzf.png

    Code:

    <!-- Custom Code for Header Widget to Appear -->
    <?php
     
    if ( is_active_sidebar( 'custom-header-widget' ) ) : ?>
        <div id="header-widget-area" class="chw-widget-area widget-area" role="complementary">
        <?php dynamic_sidebar( 'custom-header-widget' ); ?>
        </div>
         
    <?php endif; ?>
    • This reply was modified 4 years, 8 months ago by Pcosta88.

    did you edit both the functions.php and the header.php in your child theme accordingly?

    does the widget area show in the same way as in https://pasteboard.co/Jf2CiZ3.png when you use the child theme?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Twenty Eleven Child Theme Issue’ is closed to new replies.