CT Footer extension allows for quick and easy sidebars configuration, registration and styling. When activated it replaces the default theme footer and sidebars.
Important
CT Footer extension needs to be activated in wp-admin Unyson settings menu in order to work.
In theme boilerplate inside footer.php, there is a function call fw_ct_bee_render_footer()
which renders either:
Important
Both of those footers needs to be properly styled, as theme reviewers will check the theme with and without theme plugin activated.
You can configure footer structure and classes inside extensions/ct-footer/config.php file. Below there is an example configuration with instructions in comments
<?php
/** Modify below settings to generate sidebars */
/** Set classes to each sidebar wrapper depending on number of columns */
$sidebar_wrappers = array(
/** only one sidebar */
// footer row 1, column 1
'sidebars_1_footer_1_1' => 'col-sm-12 col-md-12 col-lg-9 ct-footer-column ct-footer-column--oneColumn ct-u-padding-both-25',
// footer row 2, column 1
'sidebars_1_footer_2_1' => 'col-sm-12 col-md-12 col-lg-9 ct-footer-column ct-footer-column--oneColumn ct-u-padding-both-25',
// postfooter row 1, column 1
'sidebars_1_post-footer_1_1' => 'col-sm-12 col-md-12 col-lg-12',
// postfooter row 2, column 1
'sidebars_1_post-footer_2_1' => 'col-sm-12 col-md-12 col-lg-12',
/** two sidebars */
// footer row 1, column 1 and 2
'sidebars_2_footer_1_1' => 'col-sm-6 col-md-6 col-lg-offset-1 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
'sidebars_2_footer_1_2' => 'col-sm-6 col-md-6 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
// footer row 2, column 1 and 2
'sidebars_2_footer_2_1' => 'col-sm-6 col-md-6 col-lg-offset-1 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
'sidebars_2_footer_2_2' => 'col-sm-6 col-md-6 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
// post footer row 1, column 1 and 2
'sidebars_2_post-footer_1_1' => 'col-sm-6 col-md-6 col-lg-6 ct-postfooter-column ct-postfooter-column--left',
'sidebars_2_post-footer_1_2' => 'col-sm-6 col-md-6 col-lg-6 ct-postfooter-column ct-postfooter-column--right',
// post footer row 2, column 1 and 2
'sidebars_2_post-footer_2_1' => 'col-sm-6 col-md-6 col-lg-6 ct-postfooter-column ct-postfooter-column--left',
'sidebars_2_post-footer_2_2' => 'col-sm-6 col-md-6 col-lg-6 ct-postfooter-column ct-postfooter-column--right',
/** three sidebars */
'sidebars_3_footer_1_1' => 'col-sm-6 col-md-6 col-lg-3 ct-footer-column ct-u-padding-both-25',
'sidebars_3_footer_1_2' => 'col-sm-6 col-md-6 col-lg-3 ct-footer-column ct-u-padding-both-25',
'sidebars_3_footer_1_3' => 'col-sm-12 col-md-12 text-center-md col-lg-3 ct-footer-column ct-u-padding-both-25',
'sidebars_3_footer_2_1' => 'col-sm-6 col-md-6 col-lg-3 ct-footer-column ct-u-padding-both-25',
'sidebars_3_footer_2_2' => 'col-sm-6 col-md-6 col-lg-3 ct-footer-column ct-u-padding-both-25',
'sidebars_3_footer_2_3' => 'col-sm-12 col-md-12 text-center-md col-lg-3 ct-footer-column ct-u-padding-both-25',
/** post footer has only 2 columns, so leave below empty or delete it */
'sidebars_3_post-footer_1_1' => '',
'sidebars_3_post-footer_1_2' => '',
'sidebars_3_post-footer_1_3' => '',
'sidebars_3_post-footer_2_1' => '',
'sidebars_3_post-footer_2_2' => '',
'sidebars_3_post-footer_2_3' => '',
/** four sidebars */
'sidebars_4_footer_1_1' => 'col-sm-6 col-md-6 col-lg-offset-1 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
'sidebars_4_footer_1_2' => 'col-sm-6 col-md-6 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
'sidebars_4_footer_1_3' => 'col-sm-6 col-md-6 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
'sidebars_4_footer_1_4' => 'col-sm-6 col-md-6 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
'sidebars_4_footer_2_1' => 'col-sm-6 col-md-6 col-lg-offset-1 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
'sidebars_4_footer_2_2' => 'col-sm-6 col-md-6 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
'sidebars_4_footer_2_3' => 'col-sm-6 col-md-6 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
'sidebars_4_footer_2_4' => 'col-sm-6 col-md-6 col-lg-4 ct-footer-column ct-footer-column--twoColumns ct-u-padding-both-25',
/** post footer has only 2 columns, so leave below empty or delete it */
'sidebars_4_post-footer_1_1' => '',
'sidebars_4_post-footer_1_2' => '',
'sidebars_4_post-footer_1_3' => '',
'sidebars_4_post-footer_1_4' => '',
'sidebars_4_post-footer_2_1' => '',
'sidebars_4_post-footer_2_2' => '',
'sidebars_4_post-footer_2_3' => '',
'sidebars_4_post-footer_2_4' => '',
);
$cfg = array(
/** How many rows with sidebars should the footer consist of? */
'footer_elements' => array(
/** sidebar_id => properties */
'footer_1' => array(
// name of sidebars in this row
'name' => 'Upper footer',
// number of sidebars in this row
'sidebars' => 4,
// HTML before sidebar
'before' => '<div class="ct-footer-line"></div><div class="ct-footer ct-u-padding-both-35"><div class="container"><div class="row">',
// HTML after sidebar
'after' => '</div></div></div></div>',
),
'footer_2' => array(
'name' => 'Lower footer',
'sidebars' => 4,
'before' => '<div class="ct-footer-line"></div><div class="ct-footer ct-u-padding-both-35"><div class="container"><div class="row">',
'after' => '</div></div></div></div>',
),
'post-footer_1' => array(
'name' => 'Upper post footer',
'sidebars' => 2,
'before' => '<div class="ct-postfooter ct-u-padding-both-25"><div class="container"><div class="row">',
'after' => '</div></div></div>',
),
'post-footer_2' => array(
'name' => 'Lower post footer',
'sidebars' => 2,
'before' => '<div class="ct-postfooter ct-u-padding-both-25"><div class="container"><div class="row">',
'after' => '</div></div></div>',
),
),
/** Assign sidebar classes from above, do not change */
'sidebar_wrappers' => $sidebar_wrappers,
);
There are hooks which allow you to overwrite default HTML rendered by the extension, skip selected sidebars or change their properties. These are:
Footer output (everything) hooks:
apply_filters( 'fw_ext_ct_footer_before_footer', '<footer class="ct-footer">' );
apply_filters( 'fw_ext_ct_footer_after_footer', '</footer>' );
apply_filters( 'fw_ext_ct_footer', $output, $cfg );
Footer elements (rows) hooks:
apply_filters( 'fw_ext_ct_footer_before_footer_element', $wrapper, $footer_element );
apply_filters( 'fw_ext_ct_footer_after_footer_element', $wrapper, $footer_element );
Sidebar hooks:
apply_filters( 'fw_ext_ct_footer_register_sidebar_skip', false, $element, $i, $properties );
apply_filters( 'fw_ext_ct_footer_before_sidebar', $wrapper, $sidebar_id, $footer_element, $column );
apply_filter( 'fw_ext_ct_footer_render_sidebar_output', $output, $footer_element, $column, $index, $return );
apply_filter( 'fw_ext_ct_footer_render_sidebar_return', $return, $footer_element, $column, $index, $output );
apply_filters( 'fw_ext_ct_footer_after_sidebar', $wrapper, $sidebar_id, $footer_element, $column );
Sidebar properties hooks:
apply_filters( 'fw_ext_ct_footer_register_sidebar_name', $name, $element, $properties );
apply_filters( 'fw_ext_ct_footer_register_sidebar_id', $id, $element, $properties );
apply_filters( 'fw_ext_ct_footer_register_sidebar_description', $description, $element, $properties );
apply_filters( 'fw_ext_ct_footer_register_sidebar_before_widget', $before_widget, $element, $properties );
apply_filters( 'fw_ext_ct_footer_register_sidebar_after_widget', $after_widget, $element, $properties );
apply_filters( 'fw_ext_ct_footer_register_sidebar_before_title', $before_title, $element, $properties );
apply_filters( 'fw_ext_ct_footer_register_sidebar_after_title', $after_title, $element, $properties );