• Resolved Maho1569

    (@maho1569)


    Hi, maybe somebody can help me.

    I use my own theme and plugin Events Manager 5.4.2. All works fine, but not single-event pages. I created my own template for them and called it single-event.php. I want to get header, 2 sidebars, menu and footer. But now I get the error: Fatal error: Call to a member function output_single() on a non-object instead of showing the event. I tried deleting single elements (as sidebars) but the problem is still there.

    Here is my code:

    <?php
    * Template Name: Single-Event

    get_header(); ?>

    <div class=”container”>

    <!– Sidebar laden –>

    <div id=”sidebar”>
    <?php
    get_sidebar ();
    ?>
    </div>
    <!– end sidebar –>

    <div id=”nav_kalender” role=”navigation”>

    <?php wp_nav_menu( array( ‘theme_location’ => ‘untermenu-kalender’, ‘container_class’ => ‘my_extra_menu_class’ ) );?>
    </div>
    <!–end Untermenü Museum–>

    <div class=”content2″>

    <div id=Eventseite>

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

    </div>
    <!– end EM content –>

    </div>
    <!– end content2 –>

    <div id=”sidebar3″>
    <?php get_template_part( ‘sidebar3’, ‘index’ ); ?>
    </div>
    <!– end Sidebar3 –>

    </div>
    <!– end inhalt –>

    <?php
    get_footer(); ?>

    </div>
    <!– end container –>

    I’m quite new to php, I really hope somebody can help me.

Viewing 1 replies (of 1 total)
  • Thread Starter Maho1569

    (@maho1569)

    Problem solved! Sorry for bothering you.

    The solution was simply substituting

    <div id=Eventseite>
    <?php
    global $EM_Event;
    /* @var $EM_Event EM_Event */
    echo $EM_Event->output_single();
    ?>
    </div>
    <!– end EM content –>

    by

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”artikel”>
    <?php the_content(); ?>
    </div>
    <?php endwhile; endif; ?>

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Events Manager] Fatal error when using own template single-event.php’ is closed to new replies.