Adds option to have a light or colored footer. #33

This commit is contained in:
mateuswetah 2020-07-29 16:11:55 -03:00
parent ab2a4c49ee
commit 440112a895
6 changed files with 195 additions and 15 deletions

View File

@ -84,5 +84,64 @@ footer {
}
}
}
&.tainacan-footer-colored {
background-color: #298596;
a {
color: #e6f6f8;
}
.tainacan-footer-widgets-area {
.tainacan-side ul,
.tainacan-side ol {
li {
a {
color: #e6f6f8;
}
}
}
}
.tainacan-footer-info {
.tainacan-powered {
color: #e6f6f8;
}
}
}
&.tainacan-footer-light {
background-color: #f2f2f2;
.text-white {
color: #454647 !important;
}
a {
color: #454647;
&:hover {
color: black;
}
}
.tainacan-footer-widgets-area {
.tainacan-side ul,
.tainacan-side ol {
li{
color: black;
a {
color: #454647;
&:hover {
color: black;
}
}
}
}
}
.tainacan-footer-info {
.tainacan-powered {
color: #454647;
a {
color: #222;
&:hover {
color: black;
}
}
}
}
}
}
}

View File

@ -318,6 +318,40 @@ footer{
color: #cbcbcb;
}
}
&.tainacan-footer-light {
.tainacan-side{
.textwidget, .recentcomments, .calendar_wrap, ul li, div li, div, ul, li {
color: #464748;
}
@media only screen {
@media (max-width: 991.98px){
&{
border-top: 1px solid #555758;
}
&:nth-last-child(1){
border-bottom: 1px solid #555758;
}
}
}
}
}
&.tainacan-footer-colored {
.tainacan-side {
.textwidget, .recentcomments, .calendar_wrap, ul li, div li, div, ul, li {
color: #e6f6f8;
}
@media only screen {
@media (max-width: 991.98px){
&{
border-top: 1px solid #e6f6f8;
}
&:nth-last-child(1){
border-bottom: 0px solid #e6f6f8;
}
}
}
}
}
}
// 1400px is the maximum the inner cointainer should get, so we

View File

@ -1,5 +1,5 @@
<?php if ( ! is_404() ) : ?>
<footer class="container-fluid p-4 p-sm-5 mt-5 tainacan-footer" style="padding-bottom: 0 !important;">
<footer class="container-fluid p-4 p-sm-5 mt-5 tainacan-footer <?php echo ('tainacan-footer-' . get_theme_mod( 'tainacan_footer_color', 'dark' )) ?>" style="padding-bottom: 0 !important;">
<?php if ( is_active_sidebar( 'tainacan-sidebar-footer' ) ) { ?>
<div class="row tainacan-footer-widgets-area">
<div class="col-12 col-lg">
@ -43,7 +43,7 @@
if ( get_theme_mod( 'tainacan_footer_logo' ) ) {
$footerImage = esc_attr( get_theme_mod( 'tainacan_footer_logo' ) );
} else {
$footerImage = esc_url( get_template_directory_uri() ) . '/assets/images/logo-footer.svg';
$footerImage = get_theme_mod( 'tainacan_footer_color', 'dark' ) == 'light' ? esc_url( get_template_directory_uri() ) . '/assets/images/logo.svg' : esc_url( get_template_directory_uri() ) . '/assets/images/logo-footer.svg';
}
?>
<img src="<?php echo $footerImage; ?>" class="tainacan-footer-info--logo" >

View File

@ -20,23 +20,23 @@ function tainacan_customize_register( $wp_customize ) {
'title' => __( 'Footer settings', 'tainacan-interface' ),
'priority' => 170,
));
$wp_customize->add_setting( 'tainacan_blogaddress', array(
'type' => 'theme_mod',
'capability' => 'manage_options',
'sanitize_callback' => 'sanitize_text_field'
) );
$wp_customize->add_control( 'tainacan_blogaddress', array(
'type' => 'theme_mod',
'label' => __( 'Address', 'tainacan-interface' ),
'section' => 'tainacan_footer_info',
) );
$wp_customize->add_setting( 'tainacan_blogphone', array(
'type' => 'theme_mod',
'capability' => 'manage_options',
'sanitize_callback' => 'tainacan_sanitize_phone',
) );
$wp_customize->add_control( 'tainacan_blogphone', array(
'type' => 'theme_mod',
'label' => __( 'Phone Number', 'tainacan-interface' ),
@ -48,13 +48,27 @@ function tainacan_customize_register( $wp_customize ) {
'capability' => 'manage_options',
'sanitize_callback' => 'tainacan_sanitize_email',
) );
$wp_customize->add_control( 'tainacan_blogemail', array(
'type' => 'theme_mod',
'label' => __( 'E-mail', 'tainacan-interface' ),
'section' => 'tainacan_footer_info',
) );
$wp_customize->add_setting( 'tainacan_footer_color', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'default' => 'dark',
'transport' => 'refresh',
'sanitize_callback' => 'tainacan_sanitize_footer_color_options',
) );
$wp_customize->add_control( 'tainacan_footer_color', array(
'type' => 'select',
'priority' => 6, // Within the section.
'section' => 'tainacan_footer_info',
'label' => __( 'Footer color scheme', 'tainacan-interface' ),
'choices' => tainacan_get_footer_color_options()
) );
/**
* Footer Logo customizer
*/
@ -1450,6 +1464,52 @@ if ( ! function_exists( 'tainacan_sanitize_single_item_layout_sections_order' )
}
endif; // tainacan_sanitize_single_item_layout_sections_order
if ( ! function_exists( 'tainacan_get_footer_color_options' ) ) :
/**
* Retrieves an array of options for footer color on Tainacan Theme.
*
* Create your own tainacan_get_footer_color_options() function to override
* in a child theme.
*
* @since Tainacan Theme
*
* @return array $color_options - a string describing the color style option
*/
function tainacan_get_footer_color_options() {
$color_options = array(
'dark' => __('Dark', 'tainacan-interface'),
'light' => __('Light', 'tainacan-interface'),
'colored' => __('Colored', 'tainacan-interface'),
);
return $color_options;
}
endif; // tainacan_get_footer_color_options
if ( ! function_exists( 'tainacan_sanitize_footer_color_options' ) ) :
/**
* Handles sanitization for Tainacan Theme footer color style
*
* Create your own tainacan_sanitize_footer_color_options() function to override
* in a child theme.
*
* @since Tainacan Theme
*
* @param string $option - a string describing the color style for the footer
* @return string the selected option.
*/
function tainacan_sanitize_footer_color_options( $option ) {
$color_options = tainacan_get_footer_color_options();
if ( ! array_key_exists( $option, $color_options ) ) {
return 'dark';
}
return $option;
}
endif; // tainacan_sanitize_footer_color_options
if ( ! function_exists( 'tainacan_get_single_item_navigation_links_options' ) ) :
/**
* Retrieves an array of options for single item page navigation options for Tainacan Theme.
@ -1673,6 +1733,33 @@ function tainacan_get_color_scheme_css( $colors ) {
background-color: {$colors['tainacan_link_color']} !important;
}
/* Colored version of footer */
footer.tainacan-footer-colored {
background-color: {$colors['tainacan_link_color']} !important;
}
footer.tainacan-footer-colored hr.bg-scooter {
background-color: {$colors['tainacan_tooltip_color']} !important;
}
footer.tainacan-footer-colored a,
footer.tainacan-footer-colored .tainacan-footer-widgets-area .tainacan-side ul li a,
footer.tainacan-footer-colored .tainacan-footer-widgets-area .tainacan-side ol li a,
footer.tainacan-footer-colored .tainacan-side .textwidget,
footer.tainacan-footer-colored .tainacan-side .recentcomments,
footer.tainacan-footer-colored .tainacan-side .calendar_wrap,
footer.tainacan-footer-colored .tainacan-side ul li,
footer.tainacan-footer-colored .tainacan-side div li,
footer.tainacan-footer-colored .tainacan-side div,
footer.tainacan-footer-colored .tainacan-side ul,
footer.tainacan-footer-colored .tainacan-side li,
footer.tainacan-footer-colored .tainacan-footer-info .tainacan-powered {
color: {$colors['tainacan_tooltip_color']} !important;
}
@media screen and (max-width: 991.98px) {
footer.tainacan-footer-colored .tainacan-side {
border-top-color: {$colors['tainacan_tooltip_color']} !important;
}
}
/* Blockquote */
.wp-block-quote:not(.is-large):not(.is-style-large) {
border-left-color: {$colors['tainacan_link_color']} !important;

View File

@ -67,7 +67,7 @@
</div>
</nav>
<a href="javascript:" id="return-to-top"><i class="tainacan-icon tainacan-icon-arrowup"></i></a>
<a href="javascript:" id="return-to-top" style="<?php echo (get_theme_mod( 'tainacan_footer_color', 'dark' ) == 'colored' ? 'border: 1px solid white;' : '') ?>"><i class="tainacan-icon tainacan-icon-arrowup"></i></a>
<?php if ( !is_page_template( 'page-templates/landing.php' ) ) : ?>
<?php tainacan_interface_the_breadcrumb(); ?>

File diff suppressed because one or more lines are too long