Added checkbox to display or no the Proudly powered; Show the info in the footer if has the info. #1

This commit is contained in:
Fabiano 2018-08-06 13:37:04 -03:00
parent f8fcc60350
commit 95e49b2c30
2 changed files with 51 additions and 11 deletions

View File

@ -20,20 +20,28 @@
else :
echo '</p><p>';
endif;
echo get_option('blogaddress', '');
if ( get_option('blogaddress') ) {
echo get_option('blogaddress', '');
}
?>
</p>
<p class="tainacan-footer-info--blog">
<?php
_e('E-mail: ');
echo get_option('blogemail', '');
if(wp_is_mobile()) :
echo '<br>';
else :
echo ' - ';
endif;
_e('Telephone: ');
echo get_option('blogphone', '');
if( get_option('blogemail') ) {
_e('E-mail: ');
echo get_option('blogemail', '');
}
if(get_option('blogemail') && get_option('blogphone')) {
if(wp_is_mobile()) :
echo '<br>';
else :
echo ' - ';
endif;
}
if( get_option('blogphone') ) {
_e('Telephone: ');
echo get_option('blogphone', '');
}
?>
</p>
</div>
@ -41,7 +49,13 @@
<img src="<?php if(get_theme_mod( 'footer_logo' )) { echo get_theme_mod( 'footer_logo' ); }else{ echo get_template_directory_uri() ?>/assets/images/logo-footer.svg<?php }?>" class="tainacan-footer-info--logo" alt="">
</div>
<div class="col-12 tainacan-powered">
<span><?php _e('Proudly powered by Wordpress and Tainacan'); ?></span>
<span>
<?php
if(get_theme_mod( 'display_powered')) {
_e('Proudly powered by Wordpress and Tainacan');
}
?>
</span>
</div>
</div>
</footer>

View File

@ -48,6 +48,23 @@ function tainacan_customize_register( $wp_customize ) {
'label' => __( 'E-mail' ),
'section' => 'footer_info',
) );
/**
* Checkbox to display or no the Proudly Powered by Wordpress and Tainacan.
*/
$wp_customize->add_setting( 'display_powered', array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'display_powered_sanitize_checkbox',
) );
$wp_customize->add_control( 'display_powered', array(
'type' => 'checkbox',
'settings' => 'display_powered',
'section' => 'footer_info', // Add a default or your own section
'label' => __( 'Display Proudly', 'tainacan-theme' ),
'description' => __( 'This checkbox display or no the proudly powered.' ),
) );
/**
* Footer Logo customizer
@ -128,6 +145,15 @@ function tainacan_customize_register( $wp_customize ) {
}
add_action( 'customize_register', 'tainacan_customize_register', 11 );
/**
* Callback to Checkbox to display or no the
* Proudly Powered by Wordpress and Tainacan.
*/
function display_powered_sanitize_checkbox( $checked ) {
// Boolean check.
return ( ( isset( $checked ) && true == $checked ) ? true : false );
}
/**
* Registers color schemes for Tainacan Theme.
*