Adds link (and option to change it) to the footer logo. #38

This commit is contained in:
mateuswetah 2021-04-22 14:53:23 -03:00
parent e399cc775e
commit 787659e72f
2 changed files with 16 additions and 3 deletions

View File

@ -44,13 +44,15 @@
$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';
}
?>
<a href="<?php echo get_theme_mod('tainacan_footer_logo_link', 'https://tainacan.org') ?>">
<img src="<?php echo $footerImage; ?>" class="tainacan-footer-info--logo" >
</a>
</div>
<div class="col-12 tainacan-powered">
<span>
<?php if ( true == get_theme_mod( 'tainacan_display_powered', false ) ) {
/* translators: 1: WordPress; 2: Tainacan*/
printf( __( 'Proudly powered by %1$s and %2$s.', 'tainacan-interface' ), '<a href="https://wordpress.org/">WordPress</a>', '<a href="http://tainacan.org/">Tainacan</a>' ); } ?>
printf( __( 'Proudly powered by %1$s and %2$s.', 'tainacan-interface' ), '<a href="https://wordpress.org/">WordPress</a>', '<a href="https://tainacan.org/">Tainacan</a>' ); } ?>
</span>
</div>
</div>

View File

@ -77,7 +77,6 @@ function tainacan_customize_register( $wp_customize ) {
'capability' => 'manage_options',
'sanitize_callback' => 'tainacan_sanitize_upload',
) );
$wp_customize->add_control(
new WP_Customize_Image_Control($wp_customize, 'tainacan_footer_logo',
array(
@ -88,6 +87,18 @@ function tainacan_customize_register( $wp_customize ) {
)
);
$wp_customize->add_setting( 'tainacan_footer_logo_link', array(
'type' => 'theme_mod',
'capability' => 'manage_options',
'default' => 'https://tainacan.org',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'tainacan_footer_logo_link', array(
'type' => 'theme_mod',
'label' => __( 'Logo link', 'tainacan-interface' ),
'section' => 'tainacan_footer_info',
) );
/**
* Checkbox to display or no the Proudly Powered by WordPress and Tainacan.
*/