• I’m trying to show the items in the search area as a checkbox instead of a pulldownlist. The categories are now alltogether in one list, but I want visitor to have the option to select more options.

    First of all I tried to add the sample code to the functions.php in the template folder. Unfortunately I don’t see any changes to the search area. Can somebody help me with that first step?

    Added this to functions.php

    add_action('em_template_events_search_form_ddm', 'my_em_styles_search_form');
    function my_em_styles_search_form(){
        $my_em_styles = (is_array(get_option('my_em_styles'))) ? get_option('my_em_styles'):array();
        ?>
        <!-- START Styles Search -->
        <select name="style">
            <option value=''>All Styles</option>
            <?php foreach($my_em_styles as $style_id=>$style_name): ?>
                <option value="<?php echo $style_id; ?>" <?php echo ($_POST['style'] == $style_id) ? 'selected="selected"':''; ?>><?php echo $style_name; ?></option>
            <?php endforeach; ?>
        </select>
        <!-- END Styles Search -->
        <?php
    }
    
    function my_em_styles_accepted_searches($searches){
        $searches[] = 'style';
        return $searches;
    }
    add_filter('em_accepted_searches','my_em_styles_accepted_searches',1,1);
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Searchform changes don’t work’ is closed to new replies.