Resolved

changes in child theme not showing up

Ultra Theme started by Sebastian Apr 11, 2021 6 replies
Sebastian Apr 11, 2021 · 1:00 am #15589

Hi, I was wondering if you could help me with a small issue. I created a child theme of Ultra, and made some changes in template-tags.php. However, those changes are not visible. It only works if done to the parent theme. I have cache disabled. Thank you in advance.

Andrew Misplon Puro Apr 11, 2021 · 10:01 am #15594

Hi Sebastian

Thanks for reaching out.

Unless you’re including/requiring the template-tags.php file in the child theme it won’t be loaded. Try copying the entire function you’re editing and insert that function into your child theme functions.php file.

Sebastian Apr 11, 2021 · 3:29 pm #15595

Yes, thank you. This works like a charm.
I cannot, however, get the sidebar widgets title tags right. Even tried to deregister and register my own sidebar with no effect. Any clues appreciated.

Sebastian Apr 12, 2021 · 4:19 pm #15601

Yes, I have tried that without any success.

Not sure if I do this right, so my code looks like this:

add_filter(‘ultra_widgets_init’ , ‘change_footer_title’);
function change_footer_title() {
$widget_array = array(
‘name’ => esc_html__( ‘Footer’, ‘ultra’ ),
‘id’ => ‘sidebar-2’,
‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</aside>’,
‘before_title’ => ‘<p class=”widget-title-1″>’,
‘after_title’ => ‘</p>’, );
return $widget_array;}

Sebastian Apr 12, 2021 · 4:34 pm #15603

Ok, Actually found the solution by unregisterring sidebar-2 first.
Thank you for your assistance. Much appreciated. In case someone else needs it, here is the code:

add_action( ‘widgets_init’, ‘parent_override’,11 );
function parent_override() {

unregister_sidebar(‘sidebar-2’);
/** I have looked for the ID of the sidebar by looking at
* the source code in the admin.. and saw the widget’s id=”sidebar-4″
*/

register_sidebar(array(
‘name’ => esc_html__( ‘Footer’, ‘ultra’ ),
‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</aside>’,
‘before_title’ => ‘<p class=”widget-title-1″>’,
‘after_title’ => ‘</p>’,
));
}

Andrew Misplon Puro Apr 12, 2021 · 4:51 pm #15604

Super, glad to hear you’re making progress. Thanks for the updates 🙂

7 posts