Add a New Footer Widgets Column
/** * Add your own footer widgets columns * Add a number between 1 to 7 */ function my_footer_widgets_columns() { // Add your column number $columns = '5'; // Return return $columns; } add_filter( 'ocean_footer_widgets_columns', 'my_footer_widgets_columns' ); /** * Create a new footer widget area */ function my_footer_widget_area() { // Footer 5 register_sidebar( array( 'name' => esc_html__( 'Footer 5', 'oceanwp' ), 'id' => 'footer-five', 'description' => esc_html__( 'Widgets in this area are used in the fifth footer region.', 'oceanwp' ), 'before_widget' => '<div class="footer-widget %2$s clr">', 'after_widget' => '</div>', 'before_title' => '<h6 class="widget-title">', 'after_title' => '</h6>', ) ); } add_action( 'widgets_init', 'my_footer_widget_area', 11 );
Then, follow these steps to add this new column to the footer:
- 1
- Create a partials folder in your child theme, in this folder, create another one named footer.
- 2
- Copy the widgets.php file from oceanwp/partials/footer/ in the same folder of the child theme.
- 3
- Open this file in your text editor and add the following code after the Footer box 4:
<div class="footer-box <?php echo esc_attr( $grid_class ); ?> col col-5"> <?php dynamic_sidebar( 'footer-five' ); ?> </div><!-- .footer-box -->
All PHP snippets should be added via a child theme's functions.php file.