WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] About public event form and categories select (5 posts)

  1. Christian
    Member
    Posted 1 year ago #

    Hello,

    I'm playing around with dedicated public event forms. Really easy !!!
    So for this I customise the templates in my theme.

    Just a trick for others that can help a lot :
    As I want to have specific forms, I use this trick to deploy differents templates.

    For example, I create in <mytheme> and plugins subdir, the following file:
    event-editor.php.

    It contains (pseudo code):

    <?php
    if (mycriteria === 'criteria1') {
    get_template_part('mycriteria','event-editor');
    } else {
    get_template_part('othercriteria','event-editor');
    }
    ?>

    And in my thep directory I created (from original event-editor.php) 2 files called mycriteria-event-editor.php and othercriteria-event-editor.php. Like this I can use many event templates forms.

    Here's for the trick but my problem concerns category selectboxes. I want, for one of my templates, list only all sub categories of a specific category. How can I do this in my temptates ?

    Thanks for your help!

    Christian

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

  2. agelonwl
    Member
    Posted 1 year ago #

    Hi,

    try template file at wp-content/plugins/events-manager/templates/forms/event/categories-public.php

    to use templates: http://wp-events-plugin.com/documentation/using-template-files/

    also, you can see some sample snippet here - http://pastebin.com/uLEak8Q5

  3. Christian
    Member
    Posted 1 year ago #

    Thanks agelonwl,

    I've just to add the required term for my parent category here:

    $categories = EM_Categories::get(array('orderby'=>'name','hide_empty'=>0));

    Right and it should do the trick ?

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    you probably want to look at templates/forms/event/public-categories.php and edit that instead, youd tweak the $args_em line

  5. Christian
    Member
    Posted 1 year ago #

    Done !!! Thanks

    My needs was to list all sub categories of en event cat.

    In my specific template, I change only the EM_Categories call with

    $categories = EM_Categories::get(array('orderby'=>'name','hide_empty'=>0,'child_of'=>get_term_by('slug', MY_SLUG, EM_TAXONOMY_CATEGORY)->term_id));`

    And all is working as expected.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.