Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #677299

    I would like to override the register_custom_sidebars function that is in the parent theme framework/php/class-sidebar-generator.php file for the simple reason of changing the sidebar widget titles from h3 to h4. I know that I could accomplish the same end result by using the context of the sidebar h3 tags to change the size, but that really defeats the purpose of having different sized heading tags. Is there a way to do this override without replacing the parent theme’s function.php with a child theme function.php and not loading the parent? That requires copying a lot of other files to the child as well, which would pretty much negate the possibility of having any upgrades being used.

    Thanks for any help you can offer.

    #678759

    Hi rwwood!

    Thank you for using Enfold.

    Use the “avia_custom_widget_args” filter. Please add this in the functions.php file:

    add_filter('avia_custom_widget_args', 'avia_custom_widget_args_mod', 10, 1);
    function avia_custom_widget_args_mod($args) {
    	$args['before_title'] = '<h3 class="widgettitle">';
    	$args['after_title']  = '</h4>';
    	return $args;
    }

    Cheers!
    Ismael

    #679227

    removed

    #680472

    Hi,

    If you can’t submit a new post then please post your other problem here. It works for other users so you might be able to if you try again.

    Best regards,
    Rikard

    #685381

    Ismael,

    This is not working, even after changing your typo in the “before” line to h4 rather than h3.

    Technically, if this works the way I think it should, the h4 should need no class name since all h4s on the site would have the same attributes as far as size, color, font, etc, and would only need a class if I wanted to change some attribute for a specific heading, but the size would not be one of those. Heading tags inherently have the size built in, or are supposed to.

    Thanks.

    • This reply was modified 8 years, 3 months ago by rwwood.
    #686726

    Hi!

    It works on my installation. Could you please provide a link to the page with the issue?

    Cheers!
    Ismael

    #686862

    You’ll have to log in as admin to see the front page because I have it closed to the public at present. Then, I’m trying to switch the widget header titles in the sidebar to h4 rather than h3.

    Thanks.

    #688311

    Hey!

    I’m sorry but I can’t find the header widget. I created a custom widget area in the Appearance > Widgets panel and then created a test page. The filter is working because the heading is set to h4. http://richardwwood.com/tests/

    Did you modify all those files in the child theme folder? And did you create change logs or notes about those modifications?

    Best regards,
    Ismael

    #688744

    I’m not sure what you mean by you can’t find the header widget. I don’t have a widget in the actual header. The h tags are in the sidebar where you put your test. But I notice that only that first title is h4, with the rest being h3.

    My whole goal it to make all h3s, for example, the same size without additional size related css. In reality, that’s how sizing for header tags, with only the colors, font or styling perhaps being changed. So, code that only affects one of the widget header tags isn’t what I’m trying to do.

    As to annotations, I believe that I’ve noted everything except for perhaps some code given me by support that I see in the single.php file. Actually, I think it’s a copy of index.php with a few changes made. I had moved the sidebar.php file into the child theme thinking I would need to modify it for the widget title names and not deleting it when I realized I didn’t.

    I hope this helps define what I’m trying to do and that there’s a way to do it easily.

    Thanks.

    #690047

    Hey!

    The h tags are in the sidebar where you put your test. But I notice that only that first title is h4, with the rest being h3.

    The filter will only work if the widgets are inside a custom widget area. If you need every widget area to have the title as h4, edit the includes > register-widget-area.php file.

    Cheers!
    Ismael

    #691099

    That file is in includes/admin/ How do I handle the child theme directory structure and function to override that file in the parent theme?

    Thanks.

    • This reply was modified 8 years, 3 months ago by rwwood.
    #692697

    Hi,

    just include those folders inside your child theme directory.

    Best regards,
    Andy

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.