Forums

Plugin: Events Manager - Catchable fatal error when clicking on event links (10 posts)

  1. lovemarisol
    Member
    Posted 4 months ago #

    I recently updated Events Manager and now I get this error when you click on an event link. Catchable fatal error: Object of class WP_Error could not be converted to string in /home/moma/public_html/melaniefionaworld.com/wp-content/themes/especial/libraries/breadcrumb.php on line 88

  2. agelonwl
    Member
    Posted 4 months ago #

  3. lovemarisol
    Member
    Posted 4 months ago #

    I've seen that page before and tried what it said and it didn't work. My whole site ended up having an error. But what that page says is to add that code to functions.php. Isn't my problem in breadcrumb.php so something there has to be fixed right?

  4. Marcus
    Member
    Posted 4 months ago #

    99.9% sure it's to do with your theme, it assumes that every post type has a normal post category (and has at least one set) when that isn't necessarily true (e.g. em events). my snippet just assigns a category automatically before the error occurs, ideally you'd fix your theme.

  5. lovemarisol
    Member
    Posted 4 months ago #

    Huh? I'm confused. What exactly am I supposed to do? I'm fixing my theme how?

  6. agelonwl
    Member
    Posted 4 months ago #

    you can try this one.

    1.)
    Edit your theme breadcrumb.php then find function simple_breadcrumb_case($der_post){

    2.)
    below that add this code global $post;

    3.)
    Find this snippet

    $ID = $category[0]->cat_ID;
    				echo get_category_parents($ID, TRUE, $markup, FALSE );

    And replace with this

    if( $post->post_type == EM_POST_TYPE_EVENT || $post->post_type == EM_POST_TYPE_LOCATION ){
    				$categories = get_the_category();
    				if( count($categories) == 0 ){
    					//assign a category to this
    					wp_set_object_terms($post->ID, 'uncategorized','category');
    				}
    			}else{
    				$ID = $category[0]->cat_ID;
    				echo get_category_parents($ID, TRUE, $markup, FALSE );
    			}
  7. lovemarisol
    Member
    Posted 4 months ago #

    I did that and now my whole site is down and has this error:
    Parse error: syntax error, unexpected '&' in /home/moma/public_html/melaniefionaworld.com/wp-content/themes/especial/libraries/breadcrumb.php on line 80

  8. agelonwl
    Member
    Posted 4 months ago #

    Is it possible to post your breadcrumb.php codes using pastebin?

  9. lovemarisol
    Member
    Posted 4 months ago #

    Ok I put it on pastebin & here's the link: http://pastebin.com/UeDqEjfs

  10. lovemarisol
    Member
    Posted 4 months ago #

    The problem has been fixed. Thank you so much to everyone who tried to help me get it fixed.

Reply

You must log in to post.

About this Topic