Fatal error: Call for undefined function is_shop()

Homepage Forums Minimal Grid Fatal error: Call for undefined function is_shop()

This topic contains 2 replies, has 2 voices, and was last updated by  Ramchilla 1 week, 4 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2575

    pio0O
    Participant

    Hi there
    I noticed an error after a recent theme upgrade:
    Fatal error: Call to undefined function is_shop() in .../wp-content/themes/minimal-grid/inc/template-tags.php on line 228

    This occurs when I try to access the archive pages for instance [website url]/2019/02/

    This used to work fine with an older version of the theme.

    Any ideas how I can fix it?

    Cheers

    #2762

    Ramchilla
    Participant

    I had the same exact problem and I was able to fix it by changing that line in the file to this:

    } elseif ( function_exists('is_shop') && is_shop() && $shop_id = wc_get_page_id( 'shop' ) ) {
          $title = get_the_title( $shop_id );
     }

    is_shop() is a WooCommerce function, so if you don’t have Woocommerce, the line will fail. I fixed mine by first checking if the function even exists, but you can solve it other ways.

    Hope that helps.

    #2804

    Ramchilla
    Participant

    Just an update, in the Version 1.1.1, the block in question above was removed, so it should be okay after updating to 1.1.1

    This was fresh in my head so I thought I would post in case anyone else is looking for answers around this.

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

You must be logged in to reply to this topic.