Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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-138801

    When 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,
    Frank

    #289118

    Hi 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ünter

    #289236

    Thank 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,
    Frank

    #289302

    Hi!

    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,
    Ismael

    #289392

    Thank you, this is working, I am HAPPY

    Regards,
    Frank

    #289414

    Hi!

    Glad we could help you. Thank you for visiting the forum.

    Regards,
    Günter

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘change size of sidebar in functions.php’ is closed to new replies.