-
AuthorPosts
-
July 4, 2014 at 12:12 pm #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.July 5, 2014 at 5:59 am #287455Hi!
Make sure to put this at the start of the child functions.php:
global $avia_config;
Regards,
JosueJuly 8, 2014 at 10:56 am #288395Thanks 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 */
July 8, 2014 at 1:04 pm #288480Hi!
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.
July 9, 2014 at 1:58 am #288737Thank 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.
-
AuthorPosts
- The topic ‘Change default sidebar width’ is closed to new replies.