-
AuthorPosts
-
July 9, 2014 at 4:55 pm #289100
Hi,
I am trying to follow the solution to resize the sidebar as suggested in
https://kriesi.at/support/topic/changing-the-sidebar-width-and-keeping-it-responsive/#post-138801When applying the changes in the parent theme functions.php it works nicely.
When applying the changes in the child-theme functions.php unfortunately not.Anything I am doing wrong?
Tx,
FrankJuly 9, 2014 at 5:19 pm #289118Hi frankwelschlehmann!
Thank you for using our theme
You must put your changes in an action hook, because the child theme functions.php is loaded before the parent functions.php and therefore your settings are overwritten again.
Put the following in child functions.php:
add_action('init', 'my_change_function', 90); function my_change_function() { // insert your code here }
my_change_function must be a unique name – so choose something concerned with your company to avoid the possibility of duplicate names.
Cheers!
GünterJuly 9, 2014 at 10:31 pm #289236Thank you for your advice. But I seem to have missed some detail as it is not working yet.
I have now:
add_action( 'init', 'wlcom_right_sidebar_larger', 90); function wlcom_right_sidebar_larger() { $avia_config['layout']['fullsize'] = array('content' => 'twelve alpha', 'sidebar' => 'hidden', 'meta' => 'two alpha', 'entry' => 'eleven'); $avia_config['layout']['sidebar_left'] = array('content' => 'eight', 'sidebar' => 'four alpha' ,'meta' => 'two alpha', 'entry' => 'eight'); $avia_config['layout']['sidebar_right'] = array('content' => 'eight alpha', 'sidebar' => 'four alpha', 'meta' => 'two alpha', 'entry' => 'eight alpha'); }
Where is my mistake?
tx,
FrankJuly 10, 2014 at 4:28 am #289302Hi!
Thank you for using the theme.
You forgot the global $avia_config variable. Please use this:
function avia_increase_sidebar_size() { 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' => 'eight', 'sidebar' => 'four alpha' ,'meta' => 'two alpha', 'entry' => 'eight'); $avia_config['layout']['sidebar_right'] = array('content' => 'eight alpha', 'sidebar' => 'four alpha', 'meta' => 'two alpha', 'entry' => 'eight alpha'); } add_action( 'init', 'avia_increase_sidebar_size', 1);
Best regards,
IsmaelJuly 10, 2014 at 10:21 am #289392Thank you, this is working, I am HAPPY
Regards,
FrankJuly 10, 2014 at 11:17 am #289414 -
AuthorPosts
- The topic ‘change size of sidebar in functions.php’ is closed to new replies.