theme development – How to Multiple div hide and show with Kirki Multicheck?

Question

Kirki Multicheck ( How do I get results on the front page?)
I want to control HTML code(Multiple div hide and show) through multiple checkboxes.

Admin Panel code:–

Kirki::add_field( 'theme', [
    'type'        => 'multicheck',
    'settings'    => 'test_multicheck_setting',
    'label'       => esc_html__( 'My Control', 'kirki' ),
    'section'     => 'single_widget',
    'default'     => array('design_one', 'design_two'),
    'priority'    => 10,
    'choices'     => [
        'design_one'   => esc_html__( 'Column', 'kirki' ),
        'design_none'  => esc_html__( 'None', 'kirki' ),
        'design_two'   => esc_html__( 'Row', 'kirki' ),
    ],
] );

Frontend code:

<?php if ( Kirki::get_option( 'cactus_option', 'test_multicheck_setting' ) == 'design_one' ) {  ?>

    <h1>html Code One</h1>

<?php  } ?>

<?php if ( Kirki::get_option( 'cactus_option', 'test_multicheck_setting' ) == 'design_two' ) {  ?>
  <H2> Html code two</H2>
<?php  } ?>

<?php if ( Kirki::get_option( 'cactus_option', 'test_multicheck_setting' ) == 'design_none' ) {  ?>
    <h3>Html code three</h3>
<?php  } ?>

0
Akash Manna 3 weeks 2021-09-07T04:50:36-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse