我希望我的手风琴默认关闭

时间:2019-01-03 16:25:14

标签: accordion

我使用的是wordpress模板,我希望默认情况下关闭手风琴,这是代码。

有人可以帮忙吗,主题设计师并不是很有帮助。

<div class="stm-accordion-single-unit <?php echo esc_attr($modern_filter_unit['slug']); ?>">
                            <a class="title" data-toggle="collapse"
                               href="#<?php echo esc_attr($modern_filter_unit['slug']) ?>" aria-expanded="true">
                                <h5><?php esc_html_e($modern_filter_unit['single_name'], 'motors'); ?></h5>
                                <span class="minus"></span>
                            </a>
                            <div class="stm-accordion-content" data-toggle="false">
                                <div class="collapse in content" id="<?php echo esc_attr($modern_filter_unit['slug']); ?>">
                                    <div class="stm-accordion-content-wrapper">
                                        <?php foreach ($terms as $term): ?>
                                            <?php if (!empty($_GET[$modern_filter_unit['slug']]) and $_GET[$modern_filter_unit['slug']] == $term->slug) { ?>
                                            <script type="text/javascript">
                                                jQuery(window).load(function () {
                                                    var $ = jQuery;
                                                    $('input[name="<?php echo esc_attr($term->slug . '-' . $term->term_id); ?>"]').click();
                                                    $.uniform.update();
                                                });
                                            </script>
                                        <?php } ?>
                                            <div class="stm-single-unit">
                                                <label>
                                                    <input type="checkbox"
                                                           name="<?php echo esc_attr($term->slug . '-' . $term->term_id); ?>"
                                                           data-name="<?php echo esc_attr($term->name); ?>"
                                                    />
                                                    <?php echo esc_attr($term->name); ?>
                                                </label>
                                            </div>
                                        <?php endforeach; ?>
                                    </div>
                                </div>
                            </div>
                        </div>

0 个答案:

没有答案