Support » Plugin: Events Manager » Search from post categories

Viewing 15 replies - 1 through 15 (of 17 total)
  • angelo_nwl


    NetWebLogic Support

    with regards to events search form, maybe you can try this tutorial –

    I tried your tutorial but I am not used with this kind of things (I am new in wp). Can you help me please ? I don’t really know with what I can remplace ‘Style’ in the first function (I tried with category and post_category and obviously it didn’t work). How can I get the event post category ?
    And then for the second function (with the filter), to what $searches= 'style' is referring ? I am lost…

    Can you explain a bit more about what you’re trying to do? That might make it easier to offer some pointers. Thanks.


    I just want my events have the same categories as my posts.

    I followed this tutorial : and the events now share the post categories.

    But in the Events Manager search form and the calendar, these categories are not considered ! So, what I want is the use of post categories instead of event categories.

    Then, I try this tutorial to add the post categories in the search form, but I really don’t know by what I should remplace ‘style’ (‘post_category’ ? ‘category’ ? didn”t work…).


    Ok, thanks. There’s an easier way to change the search category dropdown than using the second tutorial.

    Instead, you can edit the template at /events-manager/templates/templates/search/categories.php. Because you’re using the standard WordPress
    categories, you should be able to replace this line

    wp_dropdown_categories(array( 'hide_empty' => 0, 'orderby' =>'name', 'name' => 'category', 'hierarchical' => true, 'taxonomy' => EM_TAXONOMY_CATEGORY, 'selected' => $args['category'], 'show_option_none' => $args['categories_label'], 'class'=>'em-events-search-category'));

    with this one (which removes the instruction to use the Events Manager categories)

    wp_dropdown_categories(array( 'hide_empty' => 0, 'orderby' =>'name', 'name' => 'category', 'hierarchical' => true, 'selected' => $args['category'], 'show_option_none' => $args['categories_label'], 'class'=>'em-events-search-category'));

    You might want to take a look at this tutorial which shows you how to use custom templates in an upgrade safe way:

    Using Template Files


    Thank you for your answer!
    The code you gave me is efficient to change the search category dropdown, so the post categories appear as expected. But there is another problem : when choosing one of them and click on the seach button, no events are found while there are some in the selected category. It seems like something missing.

    Then, there is a solution for showing post categories in calendar widget instead of event categories ?


    Hello again,
    I tried some replacement in the code above to have the search I would like but I am not so familiar with wordpress so it doesn’t work.
    I am hopeless, can someone help me again please ?

    Can you post the code you’re using?

    Don’t forget to the use code button so it doesn’t get mangled by the forum software 🙂

    Hello caimin_nwl 🙂
    I have the code that you posted me before and I know that it can only change and display post categories instead of event categories in the dropdown search form.
    Then, I do not really know where I should change the code to search in post categories. Can you explain me please ?

    Am I right in thinking you want to have a search box that searches through both posts and events?

    You are close but it is not that !
    I just want the search box searches only event in the post categories.

    Can you post a link to your site? I think that’ll make it easier to see what’s happening / not happening…

    Hello caimin_nwl, sorry for being late.
    I can’t provide you any link because the site is actually only on local.
    I will try to explain the problem in the better way :

    Events and posts share same categories (this point is ok). So, in the search form, the users can search events with the category dropdown. In this dropdown, they should have the choice between the different post categories (this point is ok, you give me the trick).
    But then, if I have events in the category A, when I search for ‘A’ in this dropdown, the result remains empty. It is like there is no event in the category A.
    I hope I was clear :/

    Just to make sure I get it… The problem is that you’re not able to use the category name as a search term and get results?

    This is almost it !
    With the code you provided before, I am able to use (post) category name as a search term (they appear in the dropdown search). But there is no results !

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Search from post categories’ is closed to new replies.