Title: Make theme compatible with child themes?
Last modified: August 22, 2016

---

# Make theme compatible with child themes?

 *  [surferdude](https://wordpress.org/support/users/surferdude/)
 * (@surferdude)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/make-theme-compatible-with-child-themes/)
 * Hello,
 * Awesome theme, thank you very much.
 * I needed to add the following to the theme in order to make it work fully with
   a child theme where I was overriding the “bavotasan_jumbotron” function in functions.
   php…
 *     ```
       if ( ! function_exists( 'bavotasan_jumbotron' ) ) {
       function bavotasan_jumbotron() {
       .....
       }
       ```
   
 * Without this code the wordpress site stops working after a few minutes and returns
   a blank white page.
 * It would be awesome if you would consider adding this code to the theme so that
   I don’t have to add it after any theme updates.
 * Thank you

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

 *  [soujohn](https://wordpress.org/support/users/soujohn/)
 * (@soujohn)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/make-theme-compatible-with-child-themes/#post-5649128)
 * surferdude, how are you overriding the jumbotron function? Because I’ve been 
   trying to so it with no success. I keep getting errors. Can you share the code
   from your child theme that is overriding the jumbotron function? Thanks.
 *  Thread Starter [surferdude](https://wordpress.org/support/users/surferdude/)
 * (@surferdude)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/make-theme-compatible-with-child-themes/#post-5649138)
 * Sure…. this is my functions.php within my child theme…
 *     ```
       <?php
       //Import the Parent Themes Stylesheet :-)
       add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' );
       function enqueue_parent_theme_style() {
           wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
       }
   
       /**
       * This is where you can copy and paste your functions !
       */
   
       add_filter('tc_credits_display', 'my_custom_credits');
       function my_custom_credits(){
       $credits = 'All Rights Reserved.';
       $newline_credits = '';
       return '
       <div class="span4 credits">
           		    	<p> · © '.esc_attr( date( 'Y' ) ).' <a href="'.esc_url( home_url() ).'" title="'.esc_attr(get_bloginfo()).'" rel="bookmark">'.esc_attr(get_bloginfo()).'</a> · '.($credits ? $credits : 'Designed by <a href="http://www.themesandco.com/">Themes & Co</a>').' ·'.($newline_credits ? '<br />· '.$newline_credits.' ·' : '').'</p>		</div>';
       }
   
       /**
        * Create the jumbo headline section on the home page
        *
        * @since 1.0.0
        */
       function bavotasan_jumbotron() {
       	$bavotasan_theme_options = bavotasan_theme_options();
       	if ( ! empty( $bavotasan_theme_options['jumbo_headline_title'] ) ) {
       	?>
   
       	<?php if ( is_front_page() || is_home() ){?>
   
       	<?php if ( is_active_sidebar( 'jumbotron_sidebar_1' ) ) { ?>
       							<div id="jumbotron-sidebar" class="custom-jumbotron visible-md-* visible-lg-* hidden-xs" role="complementary">
       							<?php dynamic_sidebar( 'jumbotron_sidebar_1' ); ?>
       							</div><!-- #jumbotron-sidebar -->
       							<?php } else {?>
       	<div class="home-top">
       		<div class="container">
       			<div class="row">
       				<div class="home-jumbotron jumbotron col-lg-10 col-lg-offset-1 col-sm-12 test">
       					<h1><?php echo $bavotasan_theme_options['jumbo_headline_title']; ?></h1>
       					<p class="lead"><?php echo $bavotasan_theme_options['jumbo_headline_text']; ?></p>
       					<?php if ( ! empty( $bavotasan_theme_options['jumbo_headline_button_text'] ) ) { ?>
       					<a class="btn btn-lg btn-primary" href="<?php echo $bavotasan_theme_options['jumbo_headline_button_link']; ?>"><?php echo $bavotasan_theme_options['jumbo_headline_button_text']; ?></a>
       					<?php } ?>
       					<i class="middle-circle icon-off"></i>
       				</div>
       			</div>
       		</div>
       	</div>
       	<?php } ?>
       	<?php
       	}
       	}
       }
   
       /**
        * Register our widgets
        *
        */
       function extra_widgets_init() {
   
       	register_sidebar( array(
       		'name' => 'Header Left',
       		'id' => 'header_left_sidebar_1',
       		'before_widget' => '<div class="header-widget header-left">',
       		'after_widget' => '</div>',
       		'before_title' => '',
       		'after_title' => '',
       	) );
   
       	register_sidebar( array(
       		'name' => 'Header Right',
       		'id' => 'header_right_sidebar_1',
       		'before_widget' => '<div class="header-widget header-right">',
       		'after_widget' => '</div>',
       		'before_title' => '',
       		'after_title' => '',
       	) );
   
       	register_sidebar( array(
       		'name' => 'Custom Jumbotron',
       		'id' => 'jumbotron_sidebar_1',
       		'before_widget' => '<div class="custom-jumbotron-outer">',
       		'after_widget' => '</div>',
       		'before_title' => '',
       		'after_title' => '',
       	) );
   
       }
       add_action( 'widgets_init', 'extra_widgets_init' );
   
       ?>
       ```
   
 * You have to unfortunately add the code to the parent theme as shown above in 
   my original post too otherwise WordPress on Linux complains with an error and
   WordPress on windows just shows a blank page.
 * My only real change to the Jumbotron IIRC was to make it visible on the homepage
   only. I’d have preferred to add options to the Theme Customizer for that but 
   alas my skills aren’t there to do that yet.
 * I’ve left the rest of my changes in the code too, on the offchance they are useful.
   I hope this helps.

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

The topic ‘Make theme compatible with child themes?’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/ward/1.0.7/screenshot.png)
 * Ward
 * [Support Threads](https://wordpress.org/support/theme/ward/)
 * [Active Topics](https://wordpress.org/support/theme/ward/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/ward/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/ward/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [surferdude](https://wordpress.org/support/users/surferdude/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/make-theme-compatible-with-child-themes/#post-5649138)
 * Status: not resolved