Support » Plugin: Events Manager » [Plugin: Events Manager] Condidtional Statement by category pulling in two seperate sidebars

  • Resolved Dying2Live


    So I’m trying to write a conditional statement that will pull in two separate sidebars depending on an event category on the Single Event Page, but I’m having no luck. Any help would be appreciated and I’m willing to either do it by tag or category.

    what I have right now looks like this this:

    <?php if ( in_category( '18' ) ) : ?>
    	<?php get_sidebar('apples');?>
        <?php else: ?>
        	<?php get_sidebar('oranges');?>
    <?php endif; ?>

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • you can try this post then use wp for custom taxonomy e.g. has_term

    Thanks for the reply aglonwl.

    I tried switching the posts to pages and I’m using the “has_term” conditional tag in the single-event.php, but I’m still not having any luck. I guess what I’m not getting is how to call/single out a specific category in Events Manager. You wouldn’t happen to know how that is done would you? I cant find any documentation on it.

    This is the code that I have in my single-event.php file:

    <div class="content">
        	<div class="i-am-lazy">
            <div class="main-col">
            	<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
                	<div class="static-content">
    					<?php the_content(); ?>
                    </div><!--Close static-content --> 
            </div><!--close main body -->
                <?php if ( has_term( 'webinar' ) ) : ?>
                    <h2>What to Expect</h2>
                        <img src="<?php bloginfo('template_url'); ?>/images/gr_events_sb_img1-02.gif" border="0" /></p>
                        <strong>1. Presentations</strong>
                        We invite experts to seed our conversation.
                        <img src="<?php bloginfo('template_url'); ?>/images/gr_events_sb_img2-02.gif" border="0" />
                        <strong>2. Member Exchange</strong>
                        We discuss what we’ve heard and share our experiences.
                        <img src="<?php bloginfo('template_url'); ?>/images/gr_events_sb_img3-02.gif" border="0" />
                        <strong>3. Networking.</strong>
                        We continue the conversation and enjoy ourselves.
                <?php else: ?>
                <?php endif; ?>
        <?php endwhile; ?>
        <?php get_footer(); ?>

    I found an older post with this snippit.

    add_action('init', 'demo_add_default_boxes');
    function demo_add_default_boxes()
    register_taxonomy_for_object_type('category', 'event');
    register_taxonomy_for_object_type('category', 'event-recurring');

    I added it to my functions file and was able to use WordPress’s categories and not Event Manager’s.

    this was the older post:

    Thanks for the help though.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Events Manager] Condidtional Statement by category pulling in two seperate sidebars’ is closed to new replies.