Problem with child theme and functions.php
-
Hi,
my child theme seems to be correct installed because e.g. changes in style.css are working fine.
I downloaded the child theme of functions.php here:
https://www.themesandco.com/extension/customizr-child-theme/What I want to do is to add a new widget area and I used this:
https://www.themesandco.com/snippet/add-widget-area-header/Out of this my functions.php in the child theme looks like this:
<?php /** * This is where you can copy and paste your functions ! */ // Adds a widget area. if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => 'Extra Header Widget Area', 'id' => 'extra-widget-area', 'description' => 'Extra widget area after the header', 'before_widget' => '<div class="widget my-extra-widget">', 'after_widget' => '</div>', 'before_title' => '<h2>', 'after_title' => '</h2>' )); }
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
I tried it with and without the ‘?>’ but when I go to Appearance > widgets there is NO new widget are (named ‘register_sidebar’).
What can I do?
- The topic ‘Problem with child theme and functions.php’ is closed to new replies.