• Resolved Aldrin_PACC

    (@aldrin_pacc)


    Hi,

    I am trying to exclude specific events/categories from appearing on the main events page. I have multiple categories and would only like 1 category to be featured on the main events page and the rest to still be viewable/searchable using the WP full Calendar on a separate page.

    I tried searching and I have found a few threads but haven’t been able to get it to work. I am total n00b at PHP and new to WP. It appears that If I want to exclude categories/events from the main page I need to edit my “events-list.php” template file. I have followed the documentation on how to use/edit template files and I am having trouble successfully adding a line of code to it.

    From what I understand in order to exclude events from appearing on the main page, I have to add this code to the “events-list.php” file:

    $args[‘category’] = $_REQUEST[‘-13,-12,-8,-16,-9,-15,-11,-14,-10’]

    I have tried adding it and every time I publish a new event it will still show up on the main events page no matter where I place the code. Every event is assigned a category so I am not sure what I am doing wrong.

    Can anyone help me out or guide me in the right direction?

    Thanks!

    https://wordpress.org/plugins/events-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    Can you paste the exact code you have in your events-list.php file?

    Thread Starter Aldrin_PACC

    (@aldrin_pacc)

    Sure can!

    <?php
    /*
    * Default Events List Template
    * This page displays a list of events, called during the em_content() if this is an events list page.
    * You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
    * You can display events however you wish, there are a few variables made available to you:
    *
    * $args – the args passed onto EM_Events::output()
    *
    */
    $args[‘category’] = $_REQUEST[‘-13,-12,-8,-16,-9,-15,-11,-14,-10’]

    $args = apply_filters(’em_content_events_args’,);

    if( get_option(‘dbem_css_evlist’) ) echo “<div class=’css-events-list’>”;

    echo EM_Events::output( $args );

    if( get_option(‘dbem_css_evlist’) ) echo “</div>”;

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you can try something like this

    $args['category'] = "-13,-12,-8,-16,-9,-15,-11,-14,-10";
    Thread Starter Aldrin_PACC

    (@aldrin_pacc)

    so I tried adding that line of code above and it is still not excluding the events from the main page. Any other suggestions or ideas on why this not working? All my caches have been cleared

    This is what my current events-list.php file looks like. Am I doing something wrong?

    <?php
    /*
    * Default Events List Template
    * This page displays a list of events, called during the em_content() if this is an events list page.
    * You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
    * You can display events however you wish, there are a few variables made available to you:
    *
    * $args – the args passed onto EM_Events::output()
    *
    */
    $args[‘category’] = “-13,-12,-8,-16,-9,-15,-11,-14,-10”;

    $args = apply_filters(’em_content_events_args’,);

    if( get_option(‘dbem_css_evlist’) ) echo “<div class=’css-events-list’>”;

    echo EM_Events::output( $args );

    if( get_option(‘dbem_css_evlist’) ) echo “</div>”;

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Excluding Events/Categories from main events page’ is closed to new replies.