WordPress.org

Ready to get started?Download WordPress

Forums

[events-manager] Events/Location pages, can't get sidebar? (21 posts)

  1. taipeievents
    Member
    Posted 2 years ago #

    Hello,

    I just recently installed WordPress and things are going well.

    I have only one major problem, I can't get the sidebar to show up in single Events pages and single Location pages using Events Manager.

    How do I do it? I've enabled the sidebar theme in WordPress settings. The pages I've created are fine.

    I'm using the latest version of WordPress, Twenty Eleven theme, and Events Manager.

    Any ideas?

    Here is what I've got so far... http://www.taipeievents.com

  2. taipeievents
    Member
    Posted 2 years ago #

    Oh and the other major problem (maybe it's related?) is that a new Location takes it's #_LOCATIONNOTES from the #_EVENTNOTES of the Event that created the Event.

    :(

  3. agelonwl
    Member
    Posted 2 years ago #

    Single Events Page Sidebar, try these things:

    1. try going to settings > pages > event pages and choosing to display events as a page, not post

    2. create a single-event.php file in your theme (e.g. a copy of single.php or page.php) and modify that to add your custom sidebar.

  4. taipeievents
    Member
    Posted 2 years ago #

    Thanks!

    1. Tried changing it to the "posts" and "pages" but it has little effect.

    2. Found event-single.php. It has very little in it :/

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

    I tried adding get_sidebar(); at the end but that just put the sidebar underneath the event content.

    I'm quite lost, the more I read, the more confused I get. I thought it would be simple to add a sidebar to these event pages. I'm pretty new to PHP.

    Have any code suggestions? or an example I could look at?

    Thanks again.

  5. agelonwl
    Member
    Posted 2 years ago #

    you can do something like these:

    1. create file single-event.php in your theme (e.g. /wp-content/themes/twentyeleven/single-event.php)

    2. copy these snippet

    <?php get_header(); ?>
    <div id="primary">
    	<div id="content" role="main">
    		<?php
    			global $post;
    
    			$EM_Event = em_get_event($post->ID, 'post_id');
    		?>
    
    		<header class="entry-header">
    		<h1 class="entry-title"><?php echo $EM_Event->output('#_EVENTNAME'); ?></h1>
    		</header>
    
    		<div class="entry-content">
    		<p><?php echo $EM_Event->output('#_EVENTNOTES'); ?></p>
    		</div>
    
    	</div><!-- #content -->
    </div><!-- #primary -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  6. taipeievents
    Member
    Posted 2 years ago #

    Thanks for the example code! I see how the code works to call stuff from $EM_Event. I still have a few problems with the pages though.

    1. The Event name is printed twice. It's like my template is being used inside of another template. The content is all nested underneath the first title.
    2. The sidebar shows up under the #_EVENTNOTES not on the right.

    I checked my page using the http://validator.w3.org/ and it told me there are two instances of the "primary" div.

    It feels like there is something really wrong with my Events Manager. I wonder if this is a problem with my host's setup of WordPress. I use Freehostia.

    Here is an example page:
    http://taipeievents.com/?event=2012-neihu-strawberry-festival

    I'm going through the HTML it creates to see what's going on.

  7. taipeievents
    Member
    Posted 2 years ago #

    I'm looking at the code from a page with a sidebar that works and one that doesn't. Maybe the key to the problem is here?

    From a Single Events page, with no sidebar showing
    http://taipeievents.com/?event=ignite-taipei-4

    <body class="single single-event postid-122 logged-in admin-bar custom-background single-author singular two-column right-sidebar" onclick="if(stWidget.buttonClicked==false){stWidget.stopClosing=false;stWidget.openDuration=0;stWidget.stClose(100);}">

    From a Single Page, with sidebar that works

    <body class="page page-id-127 page-template page-template-sidebar-page-php logged-in admin-bar custom-background single-author two-column right-sidebar" onclick="if(stWidget.buttonClicked==false){stWidget.stopClosing=false;stWidget.openDuration=0;stWidget.stClose(100);}">

  8. taipeievents
    Member
    Posted 2 years ago #

    I think I've figured out something using the Reveal plugin, which tells me which template file is being used on each page.

    The pages that have a sidebar are the ones I've created myself like this page. They seem to be using the /twentyeleven/sidebar-page.php template.

    The pages that Events Manager auto generates for Events, Locations and Categories are using the /twentyeleven/page.php template. These pages don't have sidebars like this page.

    So, I tried modifying the page.php template and adding a <?php get_sidebar() ?> function but it wouldn't properly position on the right side no matter where I placed it in page.php.

    It feels like there is something wrong with my installation of Events Manager or WordPress. I think the single-event.php template I made is being fed into the page.php and that is causing problems.

    I've been working on this for 24 hours and sadly am not any closer to the solution.

    Does anybody have any ideas for me to try?

  9. agelonwl
    Member
    Posted 2 years ago #

    @taipeievents
    am going to try this again and update you.

  10. davlermedia1040
    Member
    Posted 2 years ago #

    I've been having a similarly difficult time getting the sidebar to work properly with EM as well. I have them on my individual events/locations (by modifying the page.php template in wordpress), but they get pushed to the bottom -

    http://thoughtgallery.org/locations/the-morgan-library-museum/

    I've tried messing with single-event.php templates, but get an error every time i load them. Feel like I'm missing something very obvious, but it's been driving me nuts for a couple days now.

  11. agelonwl
    Member
    Posted 2 years ago #

    @davlermedia1040

    using single-event.php; you can try to work on the width of the primary content or create a new one for it to avoid a conflict with other post/page which uses primary div.

  12. davlermedia1040
    Member
    Posted 2 years ago #

    Thanks, @agelonwi. My issue is that I take the event-single.php file from plugins/events-manager/templates/templates and re-name it single-event.php (make no other changes to the file), move it to wp-content/themes/twentyeleven-child/ and I get the below error on single event page:

    Fatal error: Call to a member function output_single() on a non-object in /home/content/07/9135807/html/wp-content/themes/twentyeleven-child/single-event.php on line 31

  13. agelonwl
    Member
    Posted 2 years ago #

    @davlermedia1040
    you could do something like these

    <?php
    global $post;
    $EM_Event = em_get_event($post->ID, 'post_id');
    ?>
    <header class="entry-header"><h1 class="entry-title"><?php echo $EM_Event->output('#_EVENTNAME'); ?></h1></header>
    <div class="entry-content">
    <?php echo $EM_Event->output('<p>
    	<strong>Category(ies)</strong>
    	#_CATEGORIES
    </p>');
    </div>
  14. davlermedia1040
    Member
    Posted 2 years ago #

    Thanks, @agelonwi. Unfortunately, I've been unable to get anywhere with this. I'm certain that there's some obvious answer I'm missing as a noob to this whole thing and not a programmer.

    This is what an event page looks like, sidebar knocked down. Basically, the content of the event is centered on the page - http://thoughtgallery.org/events/f-scott-fitzgerald-from-paradise-to-party-lights/

    Below is the code for this page. At this point, I'm not even sure where to begin and what to place in it to get it flushed to the left. I appreciate any help; you can explain it to me like I'm 12 (or 112) if necessary.

    <?php
    global $post;
    $EM_Event = em_get_event($post->ID, 'post_id');
    ?>
    
    <?php echo $EM_Event->output('<div style="float:right; margin:0px 0px 15px 15px;">#_EVENTIMAGE</div>
    
    <p>
    
    	<strong>Date/Time</strong><br/>
    
    	#_EVENTDATES<br /><i>#_EVENTTIMES</i>
    
    </p>
    
    {has_location}
    
    <p>
    
    	<strong>Location</strong><br/>
    
    	#_LOCATIONLINK<br/>#_LOCATIONADDRESS
    
    </p>
    
    {/has_location}
    
    <p>
    
    	<strong>Category(ies)</strong>
    
    	#_CATEGORIES
    
    </p>
    
    <br style="clear:both" />
    
    #_EVENTNOTES
    
    {has_bookings}
    
    <h3>Bookings</h3>
    
    #_BOOKINGFORM
    
    {/has_bookings}');
    ?>
  15. agelonwl
    Member
    Posted 2 years ago #

    @davlermedia1040

    try adjusting the width of the primary div e.g.

    <?php get_header(); ?>
    <div id="primary" style="width: 60%">
    	<div id="content" role="main">
             <!--- em snippet -->
    	</div>
    	</div><!-- #content -->
    </div><!-- #primary -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  16. davlermedia1040
    Member
    Posted 2 years ago #

    Seems I've finally sorted it all out... thanks so much for your help, @agelonwl!

  17. agelonwl
    Member
    Posted 2 years ago #

    that's great.

  18. taipeievents
    Member
    Posted 1 year ago #

    @agelonwl

    The snippet including: <div id="primary" style="width: 60%"> seems to get the sidebar on the side of my pages now too.

    I use 80%.

    1. There is still lots of padding around the "primary" div though.

    Image --> http://imageshack.us/photo/my-images/35/screenshot20120429at924.png/
    Link --> http://taipeievents.com/?event=world-expos-pavilion-of-taipei-exhibition

    2. Also, where does the Event Title come from. I don't have it in my template. If I add my own Event Title in the code, then I have the Event Title two times.

    Here is the code I'm using in my event-single.php.

    <?php get_header(); ?>
    <div id="primary" style="width: 80%">
    
    <?php
    global $post;
    $EM_Event = em_get_event($post->ID, 'post_id');
    ?>
    
    <div style="float:left; margin:0px 20px 30px 0px;"><?php echo $EM_Event->output('#_MAP'); ?></div>
    <p>
    	<strong>Date / Time</strong><br/>
    	<?php echo $EM_Event->output('#_EVENTDATES'); ?><br /><?php echo $EM_Event->output('#_EVENTTIMES'); ?><br/>
    
    	<img src="/images/locationpin.png" width="25" height="25" margin="5" style="vertical-align:middle;" /> <?php echo $EM_Event->output('#_LOCATIONLINK'); ?><br/>
    
    <img src="/images/categorystar.png" width="25" height="25" margin="5" style="vertical-align:middle;" /> <?php echo $EM_Event->output('#_CATEGORYLINK'); ?>
    <br/><br/>
    <br style="clear:both" />
    <div style="float:left; margin:20px 20px 20px 0px;"><?php echo $EM_Event->output('#_EVENTIMAGE'); ?></div>
    <h2>Description:</h2>
    <?php echo $EM_Event->output('#_EVENTNOTES'); ?>
    <p><strong>More Information:</strong><br/>
    <a href=<?php echo $EM_Event->output('#_ATT{Website1}'); ?>><?php echo $EM_Event->output('#_ATT{Website1}'); ?></a><br/>
    <a href=<?php echo $EM_Event->output('#_ATT{Website2}'); ?>><?php echo $EM_Event->output('#_ATT{Website2}'); ?></a><br/>
    </p>
    
    	</div><!-- #content -->
    </div><!-- #primary -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I still think somehow my divs are messed up because I have way too much padding around the post.

  19. agelonwl
    Member
    Posted 1 year ago #

    @taipeievents

    1.)
    you can inspect the element using browser firebug or chrome then adjust using css

    2.)
    adding to the above post; e.g.

    <?php get_header(); ?>
    <div id="primary" style="width: 80%">
    	<div id="content" role="main">
    		<?php
    			global $post;
    			$EM_Event = em_get_event($post->ID, 'post_id');
    		?>
    		<header class="entry-header">
    			<h1 class="entry-title"><?php echo $EM_Event->output('#_EVENTNAME'); ?></h1>
    		</header>
    		<div class="entry-content">
    			<?php echo $EM_Event->output( get_option('dbem_single_event_format') ); ?>
    		</div>
    	</div>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  20. Christopher Skyi
    Member
    Posted 1 year ago #

    "1. try going to settings > pages > event pages and choosing to display events as a page, not post"

    Right, this is exactly what you would do. This is a clear feature of this plug-in, but . . . it's clearly broken, i.e., it doesn't work. So the rest of this thread works through one failed hack after another. That's reason enough for me to abandon this plug-ins. Sorry guys -- it looked good on paper, and I work for a non-profit that could have really used this, but they don't have the time and money is going to take to get this to work. By hand, I can easily create what they need using normal theme pages.

  21. utilibre
    Member
    Posted 1 year ago #

    Hi there,
    I have a similar problem with a different theme. I use mikmag and also events manager. my single events pages do not have sidebars.

    I tried to do whats been said above like creating a single-event.php file in the theme menu and trying to add php siderbar footer codes but nothing has worked yet.

    I am not an advanced user. Can you please help on this?

Topic Closed

This topic has been closed to new replies.

About this Topic