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.
changes in child theme not showing up
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.
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.
Glad to hear you’re making progress. If you’re trying to change the title tags you could check the following thread for a hand https://wordpress.org/support/topic/override-before_title-for-footer-widget/.
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;}
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>’,
));
}
Super, glad to hear you’re making progress. Thanks for the updates 🙂