New Landing How can we help? Themeforest Theme Support Neighborhood ERROR: in /var/www/wp-content/themes/neighborhood/header.php on line 20

Viewing 6 posts - 1 through 6 (of 6 total)
  • #243328
    jsjc
    Member
    Post count: 54

    I am getting an error in some pages…

    Notice: Trying to get property of non-object in /var/www/wp-content/themes/neighborhood/header.php on line 20
    Have a look to the url I have left in the private information.

    Just realized that facebook social links, link within domain instead to facebook.com!

    Looking forward to your reply.

    #243348
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Your Facebook links need to be fully qualified. Ex: https://www.facebook.com/SwiftIdeas and not facebook.com/SwiftIdeas

    What pages do you specifically get that error?

    Thanks.

    #243377
    jsjc
    Member
    Post count: 54

    Fully qualified page works! Thanks for that.

    Respect the error, it appears in every 404 page, so simply make up a page and you will se it.

    Thanks in advance!

    #243382
    David Martin – Support
    Moderator
    Post count: 20834

    1) Open header.php and locate this:

    				if ( ( function_exists('is_shop') && is_shop() ) || ( function_exists('is_product_category') && is_product_category() ) ) {
    					$post_id = wc_get_page_id( 'shop' );
    				} else {
    					$post_id = $post->ID;
    				}

    Please replace it with this:

    			if ( !is_404() ) {
    				if ( ( function_exists('is_shop') && is_shop() ) || ( function_exists('is_product_category') && is_product_category() ) ) {
    					$post_id = wc_get_page_id( 'shop' );
    				} else {
    					$post_id = $post->ID;
    				}
    			}

    Thanks,
    David

    #243517
    jsjc
    Member
    Post count: 54

    Thats sounds like an ugly fix… What about if is another not 404?

    Please add it for next update so it does not break again.

    Thanks.

    #243523
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    It specifically checks if it’s not a 404 using this: !is_404(). It will only fire on a 404 page.

    Thanks.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register