Add a New Footer Widgets Column

This is a Developer Level doc.

If you're unfamiliar with PHP and/or editing files, codes and templates, as well as with resolving possible conflict, please seek help from a professional. Under our Support Policy, we don't provide support for modifications and customization.

If you wish to increase the number of columns within the Footer Widgets area and add new columns (default OceanWP theme's max number of columns is 4), use the following PHP snippet:

/**
 * Add your own footer widgets columns
 * @return 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.
2
In the previously created folder, crate a new folder named footer (partials/footer path).
3
Copy the widgets.php file from oceanwp/partials/footer/ in the same folder of the child theme.
4
Open this file using a 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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.