How to use checkbox option for check is_home
-
I need to create a checkbox to load a popup only in the home page.
If it’s checked only loads in the home, but I don’t know how to make work.function set_plugandpop() { $options = get_option('plugandpop_settings'); // I don't know if this is right function checkWhere() { if ( $options['homeonly'] == '1' ) { return is_front_page() ; } else { return !is_admin() ; } } // I don't know If this is possible if ( checkWhere() && $options['active'] == '1' ) { create_plugandpop(); } } add_action ('init', 'set_plugandpop');
I tried
if ( is_home && $options['active'] == '1' )
But this doesn’t work.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘How to use checkbox option for check is_home’ is closed to new replies.