Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42393
    Kevin Oeste
    Guest

    Hello,
    I keep getting this error:

    [02-Sep-2021 12:55:53 UTC] PHP Notice: Trying to get property ‘post_type’ of non-object in /home/v8tvsh5/public_html/v8speedshop.com/wp-content/themes/boldgrid-pavilion/base.php on line 16

    Any ideas?

    Thanks!

    #42412
    Jesse Owens
    Keymaster

    Hi Kevin-

    Thanks for the report! This error that you’re seeing from the Pavilion Theme is only a notice, and it can be safely ignored.

    I’ve filed a bug report for our developers to get this fixed in the next update to Pavilion.

    If you need to get these notices out of your logs, you can manually modify the base.php file in the wp-content/themes/pavilion/ directory. Currently, lines 15 and 16 look like this:

    $is_sa_invoice  = 'sa_invoice' === $post->post_type;
    $is_sa_estimate = 'sa_estimate' === $post->post_type;
    

    Replace those two lines with this:

    if ( ! empty( $post ) ) {
    	$is_sa_invoice  = 'sa_invoice' === $post->post_type;
    	$is_sa_estimate = 'sa_estimate' === $post->post_type;
    } else {
    	$is_sa_invoice  = false;
    	$is_sa_estimate = false;
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Constant notice Trying to get property ‘post_type’ of non-object’ is closed to new replies.