WordPress.org

Forums

Events Manager
[resolved] Theme related problem: single events not showing (6 posts)

  1. jklodt
    Member
    Posted 1 year ago #

    Hi there,

    since one of the last updates the plugin is not working properly anymore.
    The category list is showing but the single events pages don't.

    Single-Event-Page (not working): http://www.lebenslernorte.de/events/sinnposium-bildung-bewusstsein-wenn-bildung-wieder-sinn-macht/

    Events-List (working): http://www.lebenslernorte.de/veranstaltungen/

    The theme I am using is called TheProton.

    I don't have a clue how to get started on this. I know, I should probably contact the theme author but they don't respond :(
    So I'm trying my luck here. Thank you for your support!

    Best
    Jonathan

    https://wordpress.org/plugins/events-manager/

  2. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    Hi Jonathan,

    It looks as though the output is stopping as the breadcrumbs navigation links are sent to the screen. Do you have a plugin that deals with those links? Or code in the theme for those links?

    It might be worth removing the code / plugin to see if that helps.

  3. jklodt
    Member
    Posted 1 year ago #

    Hi Caimin,

    thanks so much for your fast reply!

    The breadcrumbs are included in the theme, here is the code:

    function breadcrumbs() {
    
      $delimiter = '<span class="delimiter">&raquo;</span>';
      $name = 'Home'; //text for the 'Home' link
      $currentBefore = '<span class="current">';
      $currentAfter = '</span>';
    
      if ( !is_home() && !is_front_page() || is_paged() ) {
    
        echo '<div id="crumbs">';
    
        global $post;
        $home = get_bloginfo('url');
        echo '<a href="' . $home . '">' . $name . '</a> ' . $delimiter . ' ';
    
        if ( is_category() ) {
          global $wp_query;
          $cat_obj = $wp_query->get_queried_object();
          $thisCat = $cat_obj->term_id;
          $thisCat = get_category($thisCat);
          $parentCat = get_category($thisCat->parent);
          if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
          echo $currentBefore . single_cat_title();
          // echo ''' . $currentAfter; 
    
        } elseif ( is_day() ) {
          echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
          echo '<a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '">' . get_the_time('F') . '</a> ' . $delimiter . ' ';
          echo $currentBefore . get_the_time('d') . $currentAfter;
    
        } elseif ( is_month() ) {
          echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
          echo $currentBefore . get_the_time('F') . $currentAfter;
    
        } elseif ( is_year() ) {
          echo $currentBefore . get_the_time('Y') . $currentAfter;
    
        } elseif ( is_single() ) {
          $cat = get_the_category(); $cat = $cat[0];
          echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
          echo $currentBefore;
          the_title();
          echo $currentAfter;
    
        } elseif ( is_page() && !$post->post_parent ) {
          echo $currentBefore;
          the_title();
          echo $currentAfter;
    
        } elseif ( is_page() && $post->post_parent ) {
          $parent_id  = $post->post_parent;
          $breadcrumbs = array();
          while ($parent_id) {
            $page = get_page($parent_id);
            $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
            $parent_id  = $page->post_parent;
          }
          $breadcrumbs = array_reverse($breadcrumbs);
          foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' ';
          echo $currentBefore;
          the_title();
          echo $currentAfter;
    
        } elseif ( is_search() ) {
          echo $currentBefore . 'Suchergebnisse für '' . get_search_query() . ''' . $currentAfter;
    
        } elseif ( is_tag() ) {
          echo $currentBefore . 'Artikel mit dem Schlagwort '';
          single_tag_title();
          echo ''' . $currentAfter;
    
        } elseif ( is_author() ) {
           global $author;
          $userdata = get_userdata($author);
          echo $currentBefore . 'Artikel veröffentlicht von ' . $userdata->display_name . $currentAfter;
    
        } elseif ( is_404() ) {
          echo $currentBefore . 'Fehler 404 - Seite nicht gefunden' . $currentAfter;
        }
    
        if ( get_query_var('paged') ) {
          if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
          echo __('Seite') . ' ' . get_query_var('paged');
          if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
        }
    
        echo '</div>';
    
      }
    }
  4. jklodt
    Member
    Posted 1 year ago #

    If I deactivate all plugins I receive the following error where the breadcrumbs usually show:

    Catchable fatal error: Object of class WP_Error could not be converted to string in /home/5694/docs/lebenslernorte/wp-content/themes/proton/function/extra.php on line 181

    Line 181 shows the following "echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');":

    } elseif ( is_single() ) {
          $cat = get_the_category(); $cat = $cat[0];
          echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
          echo $currentBefore;
          the_title();
          echo $currentAfter;

    Any help highly appreciated, thank you!!

  5. jklodt
    Member
    Posted 1 year ago #

    The breadcrumbs work on any other page, just not the events plugin page.

  6. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    Looks to me like that code is not designed to work with custom post types. It might be worth contacting your theme support to see if that's the case and if they can advise you on how to fix it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic