Problems after upgrading x-store theme -Fatal error: call to undefined function

This topic has 10 replies, 3 voices, and was last updated 7 years, 2 months ago ago by Rose Tyler

  • Avatar: kimloevendahl
    kimloevendahl
    Participant
    September 5, 2017 at 10:37

    Fatal error: Uncaught Error: Call to undefined function etheme_second_cat_desc() in /home/danegtved/public_html/wp-content/themes/xstore/woocommerce/archive-product.php:95 Stack trace: #0 /home/danegtved/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(205): include() #1 /home/danegtved/public_html/wp-content/plugins/woocommerce/templates/taxonomy-product_cat.php(22): wc_get_template(‘archive-product…’) #2 /home/danegtved/public_html/wp-includes/template-loader.php(74): include(‘/home/danegtved…’) #3 /home/danegtved/public_html/wp-blog-header.php(19): require_once(‘/home/danegtved…’) #4 /home/danegtved/public_html/index.php(17): require(‘/home/danegtved…’) #5 {main} thrown in /home/danegtved/public_html/wp-content/themes/xstore/woocommerce/archive-product.php on line 95

    9 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 5, 2017 at 12:41

    Hello,

    Do you use child theme? Please try to activate parent theme. Let me know result.

    Regards

    Avatar: kimloevendahl
    kimloevendahl
    Participant
    September 5, 2017 at 14:27

    Yes we are using child theme. Parent theme works

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 5, 2017 at 14:33

    In this case, you need to check the child theme code to find out what caused the issue.

    Regards

    Avatar: kimloevendahl
    kimloevendahl
    Participant
    September 5, 2017 at 15:15

    OK. my customer is not using a second description in the category loop, so this new function is now disabled in the child theme.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 5, 2017 at 15:29

    So is your problem solved?

    Regards

    Avatar: kimloevendahl
    kimloevendahl
    Participant
    September 5, 2017 at 18:05

    in this case, but You should look into why the function etheme_second_cat_desc() need to be defined in the child theme. The general idea of a child theme is to add or supplement functions. Not reproducing them from the parent theme

    Avatar: laranz
    Laranz
    Participant
    September 6, 2017 at 06:01

    Hi,

    The function “etheme_second_cat_desc” is already described in the parent theme, so if you re-declare that in the Child theme, then you can edit the function according to your needs. To override copy the function from parent theme and past that to child theme, and do the things you want to do.

    function etheme_second_cat_desc() {
    	global $wp_query;
    	$cat = $wp_query->get_queried_object();
    
    	if( property_exists( $cat, 'term_id' ) && ! is_search() ){
    		$desc = get_term_meta( $cat->term_id, '_et_second_description', true );
    	} else {
    		return;
    	}
    
    	if ( ! empty( $desc ) ) {
    		echo '<div class="term-description et_second-description">' . do_shortcode( $desc ) . '</div>';
    	}
    	return;
    }

    Let us know,

    Thanks,
    laranz.

    Avatar: kimloevendahl
    kimloevendahl
    Participant
    September 6, 2017 at 09:48

    Thank you.
    No problem as long as you keep it that way in future upgrades…

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 6, 2017 at 13:05

    You’re welcome!

    Regards

  • Viewing 10 results - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.