Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Ben Carlo

    (@hinampaksh)

    Hey Hmseb,

    Thanks for getting in touch! Is that the exact error message you’re getting? Also, are you encountering issues on those 2 websites or are they working fine regardless?

    Ben

    Thread Starter hmseb

    (@hmseb)

    The **** represents the domain folder.

    It seems to get the MySQL server to go down once in a while.

    Plugin Contributor Ben Carlo

    (@hinampaksh)

    Hey Hmseb,

    I was wondering if it printed what line on that file the error came from? How often does the MySQL server go down? Would it be possible for you to disable the BB plugin and see if you can recreate the issue? Just thinking that a PHP notice shouldn’t cause issues like this. Something else might be.

    Ben

    Thread Starter hmseb

    (@hmseb)

    I’m trying to narrow it down, but I’m no expert.

    The server gown down once/twice a day or so.

    The line refers to this one:
    if ( ‘fl-builder-template’ == $post->post_type ) {
    //$columns[ ‘fl-builder-template-shortcode’ ] = __( ‘Shortcode’, ‘fl-builder’ );
    }

    Plugin Author Justin Busa

    (@justinbusa)

    Hey Hmseb,

    It looks like the $post variable isn’t always set which is causing the error. We’ll go ahead and get that fixed. A new update should be out very soon.

    Justin

    Recently, I was also facing this issues. I was trying to get the recent posts by category.

    Below is the code snippet:

    global $post;
    
    $recent_posts = wp_get_recent_posts( array(
    	'numberposts' => $number,
    	'category'    => $category,
    	'post_status' => 'publish'
    ) );
    
    foreach( $recent_posts as $post ){
    	echo $post["post_title"];
    }

    Here, First I was trying to get posts by the query. So, used global $post;.
    After that, I found the wp_get_recent_posts(). But, I was forgot to remove global $post;. Also, In for forloop the variable $post is used.

    For that, the issue was arisen. So, Removed global $post and updated variable $post from foreach loop with $recent_post like this:

    $recent_posts = wp_get_recent_posts( array(
    	'numberposts' => $number,
    	'category'    => $category,
    	'post_status' => 'publish'
    ) );
    
    foreach( $recent_posts as $recent_post ){
    	echo $recent_post["post_title"];
    }

    —-

    Hope it helps.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Error "Trying to get property of non-object"’ is closed to new replies.