Okay
  Public Ticket #3578559
Footer columns
Closed

Comments

  •  17
    TheSnapAgency started the conversation

    How can I make the footer have five columns? There is only option for a maximum of four in the salient settings.


  •  2,728
    Andrew replied

    Hi there,

    Thank you for getting in touch.

    Unfortunately, we currently don't have a way to add columns to the footer as this would require some extensive customization of theme files which I'm afraid we are not able to offer due to support scope limitations. 

    However, we are partnered with a trusted provider of expert-level Salient customization. If you are interested in initiating a project, we recommend referring to our guide at the following link: https://themenectar.com/salient/customization/

    We appreciate your understanding with this.

    Best Regards,

  •  17
    TheSnapAgency replied

    Hi Andrew,

    I have now added a sixth option to salient theme settings for a five-column footer. 

    (Please see the code below.  I have highlighted the new option code with a red outline)


    9453720793.png


    I have also added a new column to the (main-widgets.php) file for the new option "6", but there appears to be an issue with the widgets not registering under (appearance > widgets) for the new footer layout option I have created. 


    3103814202.png

    Please can you point me in the right direction as to where these widgets are registered when the footer option is selected so that I can extend the code for the new option?

  •  2,728
    Andrew replied

    Hi Jordan,

    Thank you for getting back to us.

    Allow me to escalate this to the developer for advice.

    Wea appreciate your patience with this.

    Kind regards,

  •  17
    TheSnapAgency replied

    Thanks Andrew

  •  987
    ThemeNectar replied

    Hey TheSnapAgency,

    You would also need to register your new widget area using the following snippet in your child theme functions.php file:

    add_action( 'widgets_init', 'salient_child_register_widget_areas' );
    function salient_child_register_widget_areas() {
      register_sidebar(
        array(
                'name'          => 'Footer Area 5',
            'id'            => 'footer-area-5',
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget'  => '</div>',
            'before_title'  => '<h4>',
            'after_title'   => '</h4>',
        )
      );
    }
    

    Kind regards

  •  17
    TheSnapAgency replied

    Hi,

    Thank you for getting back to me with this update.

    I also need to know which part of the code registers the remaining four existing widgets as they do not appear when I select the new option I have created.

  •  987
    ThemeNectar replied

    You're welcome, TheSnapAgency

    The widgets are registered in salient/nectar/helpers/widget-related.php

    Kind regards

  •  17
    TheSnapAgency replied

    Thank you for the information.

    Do you know whether it would be possible to develop these files out and then add them to the child theme so that when the theme updates, it does not overwrite the new code I have created?

  •  987
    ThemeNectar replied

    You're welcome,  TheSnapAgencysmile.png
    That the widget-related file can't be dragged into a child theme. However, instead of going that route, you could just copy all of the needed register_sidebar calls into your child theme functions.php e.g.

    add_action( 'widgets_init', 'salient_child_register_widget_areas' );
    function salient_child_register_widget_areas() {
      register_sidebar(
        array(
                'name'          => 'Footer Area 5',
            'id'            => 'footer-area-5',
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget'  => '</div>',
            'before_title'  => '<h4>',
            'after_title'   => '</h4>',
        )
      );
      global $nectar_options;
      $footer_columns = ( ! empty( $nectar_options['footer_columns'] ) ) ? $nectar_options['footer_columns'] : '4';
      if ( $footer_columns === '6' ) {
         // ADD ALL OF THE REGISTER CALLS HERE
      }
    }
    
  •  17
    TheSnapAgency replied

    The only problem would be that I have added a new custom option to the "options-config.php" file too. 

    Is there no way to overwrite these files in the child theme or even for me to develop the functionality for this to work? It would be good to keep building onto Salient in the child theme as there are a lot more features I'd like to add.

  •  987
    ThemeNectar replied

    In general, regular template files can be copied into the child theme, and they will be used as long as the file path matches. However, helper files that only contain functions can't be copied into a child theme. Instead, you would need to copy the functions from within the file to your child theme as needed. In the case of the function within the widgets file, it's not set up yet to be overridable via a child theme, which is why I suggested the other route of registering the sidebars via a new action.

    For this case of your footer modifications, I would recommend simply utilizing a global section instead to create your footer via the page builder, instead of following your current route if you're concerned about maintaining the modification: https://themenectar.com/docs/salient/page-builder-global-sections/