Fix footer mention option

This commit is contained in:
te2dy 2021-03-23 16:16:39 +01:00
parent 03070856e3
commit 7b4d9a82a0
4 changed files with 20 additions and 34 deletions

3
.gitignore vendored
View File

@ -1,5 +1,2 @@
# Ignore Mac DS_Store files.
.DS_Store
# Ignore README.md file.
README.md

View File

@ -164,10 +164,10 @@
'.comment-content'
],
classes = {
left: 'text-align-left',
center: 'text-align-center',
right: 'text-align-right',
justify: 'text-align-justify'
'left': 'text-align-left',
'center': 'text-align-center',
'right': 'text-align-right',
'justify': 'text-align-justify'
};
marianneSelectRadioToggleClass( target, classes, newval );
@ -192,33 +192,22 @@
} else {
$( '.site-footer' )
.prepend(
'<div id="site-footer-text" class="site-footer-block">'
+ newval
+ '</div>'
'<div id="site-footer-text" class="site-footer-block">' + newval + '</div>'
);
}
} );
} );
// Footer Settings > Default footer mention.
wp.customize( 'marianne_footer_mention', function( value ) {
value.bind( function( newval ) {
if ( newval === true ) {
$( '#site-footer-mention' ).show();
} else {
$( '#site-footer-mention' ).hide();
}
} );
} );
// Social Links > Style.
wp.customize( 'marianne_social_style', function( value ) {
value.bind( function( newval ) {
if ( newval === true ) {
$( '#site-footer-mention' ).show();
} else {
$( '#site-footer-mention' ).hide();
}
var target = '.site-social',
classes = {
'round': 'site-social-round',
'square': 'site-social-square'
};
marianneSelectRadioToggleClass( target, classes, newval );
} );
} );
} );

View File

@ -12,6 +12,12 @@
?>
<footer class="site-footer text-secondary" role="contentinfo">
<?php
if ( 'footer' === marianne_get_theme_mod( 'marianne_social_location' ) ) {
marianne_social_link();
}
?>
<?php
$marianne_footer_text = marianne_get_theme_mod( 'marianne_footer_text' );
if ( $marianne_footer_text ) {
@ -39,13 +45,7 @@
</nav>
<?php endif; ?>
<?php
if ( 'footer' === marianne_get_theme_mod( 'marianne_social_location' ) ) {
marianne_social_link();
}
?>
<?php if ( true === marianne_get_theme_mod( 'marianne_footer_mention' ) ) : ?>
<?php if ( false !== marianne_get_theme_mod( 'marianne_footer_mention' ) ) : ?>
<div id="site-footer-mention" class="site-footer-block">
<?php
printf(

View File

@ -259,7 +259,6 @@ if ( ! function_exists( 'marianne_customize_register' ) ) {
'title' => __( 'Display the default footer mention.', 'marianne' ),
'description' => __( 'Useful to promote WordPress and Marianne to your readers. Default: displayed.', 'marianne' ),
'type' => 'checkbox',
'live' => true,
);
$marianne_customizer_options[] = array(
@ -294,6 +293,7 @@ if ( ! function_exists( 'marianne_customize_register' ) ) {
'round' => __( 'Round', 'marianne' ),
'square' => __( 'Square', 'marianne' ),
),
'live' => true,
);
$marianne_customizer_options[] = array(