- This topic has 6 replies, 2 voices, and was last updated 3 years, 7 months ago by Andrew Misplon.
- AuthorPosts
- April 11, 2021 at 1:00 am #15589
SebastianParticipantHi, 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.
April 11, 2021 at 10:01 am #15594
Andrew MisplonKeymasterHi 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.
April 11, 2021 at 3:29 pm #15595
SebastianParticipantYes, 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.April 12, 2021 at 10:20 am #15598
Andrew MisplonKeymasterGlad 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/.
April 12, 2021 at 4:19 pm #15601
SebastianParticipantYes, 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;}April 12, 2021 at 4:34 pm #15603
SebastianParticipantOk, 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>’,
));
}April 12, 2021 at 4:51 pm #15604
Andrew MisplonKeymasterSuper, glad to hear you’re making progress. Thanks for the updates 🙂
- AuthorPosts
You must be logged in to reply to this topic.