Tagged: , ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #287134

    https://kriesi.at/support/topic/changing-the-sidebar-width-and-keeping-it-responsive/#post-138801
    In this post you explain how to change the default sidebar width by editing the Enfold functions.php.
    Is it possible to make this change in a child theme somehow? If the config values are changed in the child functions.php they are overridden by the parent functions.php values.

    #287455

    Hi!

    Make sure to put this at the start of the child functions.php:

    global $avia_config;
    

    Regards,
    Josue

    #288395

    Thanks Josue, doesn’t appear to have worked?

    I placed the following into my child functions.php, but the layout remains 9/3 for the sidebar-right configuration. Have I done something wrong?

    /* Include the global settings for Enfold */

    global $avia_config;

    $avia_config[‘layout’][‘fullsize’] = array(‘content’ => ‘twelve alpha’, ‘sidebar’ => ‘hidden’, ‘meta’ => ‘two alpha’, ‘entry’ => ‘eleven’);
    $avia_config[‘layout’][‘sidebar_left’] = array(‘content’ => ‘nine’, ‘sidebar’ => ‘three alpha’ ,’meta’ => ‘two alpha’, ‘entry’ => ‘nine’);
    $avia_config[‘layout’][‘sidebar_right’] = array(‘content’ => ‘eight alpha’, ‘sidebar’ => ‘four alpha’, ‘meta’ => ‘two alpha’, ‘entry’ => ‘eight alpha’); //GWB

    /* End of Enfold changes */

    #288480

    Hi!

    Thank you for coming back.

    You have to solve this problem within an action hook, because functions.php of the childtheme is loaded before the parent themes functions.php.

    Try to put the following in functions.php of the child theme:

    
    add_action('init', 'purpleedge_change_layout', 900);
    
    function purpleedge_change_layout()
    {
    global $avia_config;
    
    $avia_config['layout']['sidebar_right'] = array(‘content’ => ‘eight alpha’, ‘sidebar’ => ‘four alpha’, ‘meta’ => ‘two alpha’, ‘entry’ => ‘eight alpha’);
    }
    

    This should overwrite the settings from enfold parent theme.

    Cheers!
    Günter

    • This reply was modified 10 years, 5 months ago by Günter.
    #288737

    Thank you Gunter!

    There was a small typo in your code but following works well!

    /* Include the global settings for Enfold */
    add_action('init', 'tnb_change_layout', 900);
    function tnb_change_layout()
    {
        global $avia_config;
        $avia_config['layout']['sidebar_right'] = array('content' => 'eight alpha',   'sidebar' => 'four alpha', 'meta' => 'two alpha', 'entry' => 'eight alpha');  //GWB
    }
    /* End of Enfold changes */
    
    • This reply was modified 10 years, 5 months ago by PurpleEdge.
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Change default sidebar width’ is closed to new replies.