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:
parent
f8fcc60350
commit
95e49b2c30
|
@ -20,20 +20,28 @@
|
||||||
else :
|
else :
|
||||||
echo '</p><p>';
|
echo '</p><p>';
|
||||||
endif;
|
endif;
|
||||||
echo get_option('blogaddress', '');
|
if ( get_option('blogaddress') ) {
|
||||||
|
echo get_option('blogaddress', '');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
<p class="tainacan-footer-info--blog">
|
<p class="tainacan-footer-info--blog">
|
||||||
<?php
|
<?php
|
||||||
_e('E-mail: ');
|
if( get_option('blogemail') ) {
|
||||||
echo get_option('blogemail', '');
|
_e('E-mail: ');
|
||||||
if(wp_is_mobile()) :
|
echo get_option('blogemail', '');
|
||||||
echo '<br>';
|
}
|
||||||
else :
|
if(get_option('blogemail') && get_option('blogphone')) {
|
||||||
echo ' - ';
|
if(wp_is_mobile()) :
|
||||||
endif;
|
echo '<br>';
|
||||||
_e('Telephone: ');
|
else :
|
||||||
echo get_option('blogphone', '');
|
echo ' - ';
|
||||||
|
endif;
|
||||||
|
}
|
||||||
|
if( get_option('blogphone') ) {
|
||||||
|
_e('Telephone: ');
|
||||||
|
echo get_option('blogphone', '');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</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="">
|
<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>
|
||||||
<div class="col-12 tainacan-powered">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -49,6 +49,23 @@ function tainacan_customize_register( $wp_customize ) {
|
||||||
'section' => 'footer_info',
|
'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
|
* Footer Logo customizer
|
||||||
*/
|
*/
|
||||||
|
@ -128,6 +145,15 @@ function tainacan_customize_register( $wp_customize ) {
|
||||||
}
|
}
|
||||||
add_action( 'customize_register', 'tainacan_customize_register', 11 );
|
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.
|
* Registers color schemes for Tainacan Theme.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue