WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] taxonomy-events-categories: cannot output $EM_Category (4 posts)

  1. xymox12
    Member
    Posted 1 year ago #

    Hi

    I have had to use my own template to resolve some issues with menus. I have created the file taxonomy-events-categories.php and it has overridden the default event manager's template.

    However I still wish to use the $EM_Category output like the single em template

    global $EM_Category;
    /* @var $EM_Category EM_Category */
    echo $EM_Category->output_single();

    but this returns an 'trying to get property of non-object...' when doing this.
    How do I include the output in my custom template?
    Thanks

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

  2. agelonwl
    Member
    Posted 1 year ago #

    can you try this snippet?

    <?php get_header(); ?>
     <div class="post-inner">
     <?php
      global $post, $EM_Category, $wp_query;
         $EM_Cat = em_get_category($wp_query->queried_object->term_id);
           <h1><?php echo $EM_Cat->output('#_CATEGORYNAME'); ?></h1><br/>
           <p><?php echo $EM_Cat->output('#_CATEGORYNOTES'); ?></p><br/>
           <h3>Next Events</h3><br/>
           <div>
            <p><?php echo $EM_Cat->output('#_CATEGORYNEXTEVENTS'); ?></p>
           </div>
     </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  3. xymox12
    Member
    Posted 1 year ago #

    Excellent - thanks agelonwl. That's working a treat.

  4. agelonwl
    Member
    Posted 1 year ago #

    thanks for confirming;

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic