Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #242703

    Hi

    1. Child Theme
    I installed and activated the Enfold Child Theme (http://bit.ly/enfold-child) with Enfold v 2.6.2 as the parent theme. In the child theme, I imported the parent theme’s settings – however, the entire site design & css breaks. Also, the child theme changes the selected menus which were set for the main navigation. Do you have a child theme compatible with the latest Enfold version?

    2. Changing the Layout of the Sidebar to 2 units
    Also — what I am trying to achieve is to make the left side bar on pages smaller (*two* columns instead of *three*). So what I need to do is edit the template code so that the aside class says ‘two’ instead of ‘three’:

    
    <aside class="sidebar sidebar_left smartphones_sidebar_active three alpha units" role="complementary" itemscope="itemscope" itemtype="http://schema.org/WPSideBar">...</aside>
    

    and change <div class="template-page content nine units">...</div> to say *ten* instead of *nine*.

    What is the best way to achieve this whilst maintaining compatibility with all future auto-updates?

    • This topic was modified 10 years, 8 months ago by gorans. Reason: cleaning up formatting
    #243251

    Hi gorans!

    1) Any child theme set up as a child of enfold is compatible though when importing in the parent theme settings you may need to tweak things a bit. At the very least go into the styling options and re-save your settings and then the same in your WordPress menus manager.

    2) The functions.php has the settings for the layouts on lines 141-144. You can copy and past theme into your child theme to overwrite the data.

    Regards,
    Devin

    #245072

    Thanks Devin

    1) worked — I had the redo the menus and now everything appears the same.

    2) The layout override I’m having issues with. Because the Child functions.php is loaded before the parent’s file, it means that when I override the line:
    $avia_config['layout']['sidebar_left'] = array('content' => 'nine', 'sidebar' => 'three alpha' ,'meta' => 'two alpha', 'entry' => 'nine'); to have my settings, it is again overwritten by the parent theme’s function.php.

    I don’t want to have to copy & paste all the functions.php file from the parent into the child because then any updates to the parent won’t go through to the child theme. Is there a nicer ‘DRY’ way to do this? Ideally the parent functions.php should check to determine if that variable is set before setting the defaults.

    `

    #245078

    By way of update. I figured out how to achieve item (2)

    In the child theme’s function.php I added the following:

    
    function change_sidebar_left_layout() {
        global $avia_config;
        $avia_config['layout']['sidebar_left'] = array('content' => 'ten', 'sidebar' => 'two alpha' ,'meta' => 'two alpha', 'entry' => 'eight');
    };
    add_action('init', 'change_sidebar_left_layout');
    

    Please let me know if that is the correct way to do it.

    Thanks

    #245830

    That is a great way to do it yes.

    #320052

    Hi
    I have the same issue.
    Please could you elaborate on how you referenced ‘change_sidebar_left_layout’ and where?
    Thanks!

    #320055

    Hi!

    Please refer to Peter’s post here – https://kriesi.at/support/topic/right-sidebar-width/#post-118282

    Cheers!
    Yigit

    #320383

    Hi Yigit
    Many thanks – but I am referring to how best to amend the grid units in a child theme so that any update to the parent theme doesn’t lose the settings. Gorans answer seemed to have solved this with an addition to the child theme functions.php file – but I would like to know how that was implemented in the site itself.
    Any thoughts on how that can be done?
    Thanks again

    #320894

    Hey!

    Goran’s code references grid units, it essentially modifies the global $avia_config variable when WordPress initializes (init hook):

    function change_sidebar_left_layout() {
        global $avia_config;
        $avia_config['layout']['sidebar_left'] = array('content' => 'ten', 'sidebar' => 'two alpha' ,'meta' => 'two alpha', 'entry' => 'eight');
    };
    add_action('init', 'change_sidebar_left_layout');

    You can extend it to affect right sidebars and/or fullsize layouts:

    function change_sidebar_left_layout() {
        global $avia_config;
        $avia_config['layout']['sidebar_left'] = array('content' => 'ten', 'sidebar' => 'two alpha' ,'meta' => 'two alpha', 'entry' => 'eight');
        $avia_config['layout']['sidebar_right'] = array('content' => 'ten', 'sidebar' => 'two alpha' ,'meta' => 'two alpha', 'entry' => 'eight');
        $avia_config['layout']['fullsize'] 		= array('content' => 'twelve alpha', 'sidebar' => 'hidden', 	 'meta' => 'two alpha', 'entry' => 'eleven');
    };
    add_action('init', 'change_sidebar_left_layout');

    Best regards,
    Josue

    #321027

    Hi Josue
    Many thanks for that explanation – it’s much appreciated, however adding this code in the child theme functions file adds some to the left of the content area (I only have a right sidebar). Is there a way around this please?
    Thanks again
    Chris

    • This reply was modified 10 years, 2 months ago by cbentley65.
    #321430

    Hi Chris!

    What code have you added? can you post a link to your website please?

    Cheers!
    Josue

    #321478
    This reply has been marked as private.
    #322414

    Hi!

    No that should work correctly. The child theme is active and other functions are working as well?

    Best regards,
    Devin

    #322434

    Hi Devin
    Thanks – yes, the child theme is active and the functions file is working OK in there….
    Any thoughts?

    #323401

    If this is on a live site please provide the admin credentials here as a private reply and we’ll take a look.

    #323557
    This reply has been marked as private.
    #324119

    Hi!

    Kriesi will remove this layout class system and replace it with a much more simple content / sidebar width system. For now, the sidebar code should be:

    function change_sidebar_left_layout() {
    	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' => 'ten', 		 'sidebar' => 'two alpha' ,'meta' => 'one alpha', 'entry' => 'nine');
    $avia_config['layout']['sidebar_right'] = array('content' => 'ten alpha',   'sidebar' => 'two alpha', 'meta' => 'one alpha', 'entry' => 'nine alpha');
    }
    add_action( 'init', 'change_sidebar_left_layout', 1);

    On Enfold 3.0, you can probably just use this on Quick CSS or custom.css to change the width of the content:

    .container .av-content-small.units {
    width: 80%;
    }

    Best regards,
    Ismael

    #324904

    Hi Ismael
    Many thanks – that works well!
    Chris

    Hi Ismael – I think I spoke too soon – the content area is no longer responsive with this code in the functions file of the child theme, or with the amendment (ten, two) in the parent theme.
    I tried the Custom CSS as well but that made no difference.
    Can you assist please?
    Thankd
    Chris

    • This reply was modified 10 years, 2 months ago by cbentley65.
    #325717

    For now I would suggest simply changing the parent functions.php if the child function isn’t working for you. I’ve not had any issues with it but the change would need to be re-done in the 3.0 update anyway so there is no difference in the short term to alter the parent directly in this case.

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