I Developed My Theme To Provide two Ways of Customization, Settings API & Customization Manager API, After Finishing the Work in the Dashboard , i tried to implement them for the front-end customization, But i discovered that when i check some option in the settings API it works fine, without check it from the customizer API, But in The Conditional Work i did that some portion of code should appear in the theme incase the setting and the option is checked ( && ), But i tried to figure out what happens But unfortunately Nothing special Happens .

That's My Code :

<?php if ( get_option( 'busymarkets-left-btm-footer-setting' ) && get_theme_mod( 'busym-fbl-setting', true ) ) : ?>
    <div class="col-md-6">
        <div class="footer-copyright-text">
            if ( is_active_sidebar('busy-footer-lb-sidebar') ) :
<?php endif; 

As You See In The Code Above, i'm Working with The Operator ( && ) So The Portion of code which is Above The Sidebar Should Only Appears When The User Check The option and the setting, but unfortunately it worked like when we use the operator ( || ) .

I'm Sorry For My English , and Please If Someone Has A solution For this Override , Please Help and Thanks in Advance .

  • 1
    var_dump() both settings and check that they actually are empty. Apr 13 '18 at 3:53
  • @JacobPeattie Thanks Man for Helping, But Please How Can i Let The option automatically checked when the user used the other option ? Apr 13 '18 at 4:37
  • Why aren't you just using the customiser? Apr 13 '18 at 5:02
  • I thought of it, but i wanted to provide the user everything that makes him comfortable, and in addition i wanted to do the hard work for me to expert the wordpress . That's it , So Please @JacobPeattie is there anyway to not let the customizer overide the settings api ? Apr 13 '18 at 5:17
  • 1
    Two interfaces that do the same thing isn't going to make the user comfortable, it's going to make them confused (it's making you confused!). In fact the theme directory has forbidden setting screens for themes in favour of the customiser for 3 years now. If you must share settings between the customiser and a settings page then the customiser setting should be set to option type and save to the same option. See the type argument for $wp_customize->add_setting(). Apr 13 '18 at 5:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.