Events Manager
[resolved] Create Search Field for Custom Field or Attribute (5 posts)

  1. netforest
    Posted 3 years ago #

    Is there a guideline or suggestion for the easiest way to add a custom field or attribute to the search form? The search form works great but would like to customize it to search on custom fields or attributes.


  2. agelonwl
    Posted 3 years ago #

  3. netforest
    Posted 3 years ago #

    Thanks for tip. If I only wanted to be able to search for tags (text box search not drop down) what would I have to modify to be able to add this to the search form.

    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; ?>
    	<!-- END Styles Search -->
  4. netforest
    Posted 3 years ago #

    Nevermind. Just realized the tag search is built-in. In the first field. Thought it was a label. Excuse my ignorance.

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    do you mean in the general search field? If so, I don't think that tags are searched (if so, pleasant coincidence!)...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic