[Resolved] changes in child theme not showing up

  • Author
    Posts
  • #15589

    Sebastian
    Participant

    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.

    #15594

    Andrew Misplon
    Keymaster

    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.

    #15595

    Sebastian
    Participant

    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.

    #15598

    Andrew Misplon
    Keymaster

    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/.

    #15601

    Sebastian
    Participant

    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;}

    #15603

    Sebastian
    Participant

    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>’,
    ));
    }

    #15604

    Andrew Misplon
    Keymaster

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

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Scroll to top