WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Event List Question (10 posts)

  1. rontarson
    Member
    Posted 2 years ago #

    I am trying to edit templates/event-list.php to limit the results to only specified categories. Using the below $args, causes the category search to stop functioning completely. It does however limit the display of the events for those categories omitted.

    $args['category'] = array(6,7,8,10,11,12,13,14);

    Here is the full code from that page: http://pastebin.com/J20H9FS7

    Do I have the $args incorrectly placed?

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    Can I know what do you mean by causes the category search to stop functioning completely.? what is your expected result? and what is the actual result?

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    could you try it as just a string, i.e. '6,7,...'

  4. rontarson
    Member
    Posted 2 years ago #

    $args['category'] = '6,7,8,10,11,12,13,14'; has the same effect. Its weird though since the pagination displays the correct number of events but the event list is not updated when selecting the specified category from the drop down in my search page.

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    looking closer at your code, you're right, it is incorrectly placed, and may mess up the search results. You need to place that on line 24 of the pastebin, above the echo.

  6. rontarson
    Member
    Posted 2 years ago #

    Placing at line 24 does correct the search function however, when the list is first loaded, all categories are shown as I'm not limiting it in anyway until running the search and using the specific category IDs.

    Still looking to limit the initial event loading to specific category IDs, which I can do but brings me back to the search error as stated in the above posts.

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    what about if you leave the original line, and copy instead of move that line mentioned above?

  8. rontarson
    Member
    Posted 2 years ago #

    I've tried almost every variation of this but for some reason I cant get it to work.

    I can limit the initial events being loaded to specific IDs but search wont work.

    Or NOT limit the initial events being loaded and search does work.

    One or the other but not both. This one is a head scratcher for me.

    http://pastebin.com/85hgnx2w

  9. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    That second parameter on line 24 has to go, but aside from that, it looks ok to me.

    Which way does this snippet work, for initial load or the search?

  10. rontarson
    Member
    Posted 2 years ago #

    Removed from line 24 above is this: http://pastebin.com/Hj3rXSgy

    I get the categories limited on initial list load, but when I trigger a category search, it will not return values and only refreshes the initial event list again.

    All other event search criteria functions correctly as found on my /events/ page so it seems to only be isolated to the category field.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic