Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
#149 removed newly created option and keep the old one, as it was sup…
Browse files Browse the repository at this point in the history
…posed to do
  • Loading branch information
rodica-andronache committed Nov 21, 2016
1 parent 524127a commit ac2d511
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
16 changes: 0 additions & 16 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ function zillah_customize_register( $wp_customize ) {
$wp_customize->add_setting('zillah_sidebar_show', array(
'default' => false,
'sanitize_callback' => 'zillah_sanitize_checkbox',
'transport' => 'postMessage',
));

$wp_customize->add_control('zillah_sidebar_show', array(
Expand All @@ -79,21 +78,6 @@ function zillah_customize_register( $wp_customize ) {
'type' => 'checkbox',
));

/* Show sidebar on mobile */
$wp_customize->add_setting('zillah_sidebar_show_mobile', array(
'default' => false,
'sanitize_callback' => 'zillah_sanitize_checkbox',
'transport' => 'postMessage',
));

$wp_customize->add_control('zillah_sidebar_show_mobile', array(
'label' => esc_html__( 'Show sidebar on mobile', 'zillah' ),
'description' => esc_html__( 'If you check this box, the sidebar will appear on homepage and archive page on mobile version.', 'zillah' ),
'section' => 'zillah_home_theme_option_section',
'priority' => 1,
'type' => 'checkbox',
));

/* Show Tags */
$wp_customize->add_setting('zillah_tags_show', array(
'default' => false,
Expand Down
5 changes: 2 additions & 3 deletions sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@
*/

$zillah_sidebar_show = get_theme_mod( 'zillah_sidebar_show', false );
$zillah_sidebar_show_mobile = get_theme_mod( 'zillah_sidebar_show_mobile', false );

if ( ! is_active_sidebar( 'zillah-sidebar-1' ) ) {
return;
}
?>

<?php zillah_hook_sidebar_before(); ?>
<aside id="secondary" class="widget-area<?php echo $zillah_sidebar_show === false && is_customize_preview() ? ' zillah-only-customizer' : ''; ?><?php echo $zillah_sidebar_show_mobile ? ' widget-area-mobile' : ''; ?>" role="complementary">
<aside id="secondary" class="widget-area<?php echo $zillah_sidebar_show === false && is_customize_preview() ? ' zillah-only-customizer' : ''; ?><?php echo $zillah_sidebar_show ? ' widget-area-mobile' : ''; ?>" role="complementary">
<?php
if ( $zillah_sidebar_show_mobile ) {
if ( $zillah_sidebar_show ) {
echo '<span class="sidebar-mobile-title"><span>' . esc_html__( 'Sidebar', 'zillah' ) . '</span></span>';
}
?>
Expand Down

0 comments on commit ac2d511

Please sign in to comment.