WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Condidtional Statement by category pulling in two seperate sidebars (5 posts)

  1. Dying2Live
    Member
    Posted 2 years ago #

    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.

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

  2. agelonwl
    Member
    Posted 2 years ago #

    you can try this post http://wordpress.org/support/topic/events-manager-eventslocation-pages-cant-get-sidebar?replies=20 then use wp for custom taxonomy e.g. has_term

  3. Dying2Live
    Member
    Posted 2 years ago #

    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.

  4. Dying2Live
    Member
    Posted 2 years ago #

    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 -->
            <aside>
                <?php if ( has_term( 'webinar' ) ) : ?>
                    <h2>What to Expect</h2>
                        <p>
                        <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.
                        </p>
                        <p>
                        <img src="<?php bloginfo('template_url'); ?>/images/gr_events_sb_img2-02.gif" border="0" />
                        </p>
    
                        <strong>2. Member Exchange</strong>
                        We discuss what we’ve heard and share our experiences.
    
                        <p>
                        <img src="<?php bloginfo('template_url'); ?>/images/gr_events_sb_img3-02.gif" border="0" />
                        </p>
                        <strong>3. Networking.</strong>
                        We continue the conversation and enjoy ourselves.
                <?php else: ?>
    
                <?php endif; ?>
            </aside>
        <?php endwhile; ?>
        <?php get_footer(); ?>
  5. Dying2Live
    Member
    Posted 2 years ago #

    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:
    href="http://wordpress.org/support/topic/events-manager-using-post-categories?replies=7

    Thanks for the help though.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic