<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>method_exists()

[ad_1]

Replies: 2

Hi there

I get an error with multiple code snippets when using the plugin.

method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given

An example code snippet being used is:

function search_above_shop_loop() {
	$term = get_queried_object();
	$taxonomy = isset($term->taxonomy) ? $term->taxonomy : null;
	if( $taxonomy && ! in_array( $taxonomy, array( 'product_cat', 'product_brand' ) ) ){
		echo '<div class="shop_search_bar">'.do_shortcode('[wd_asp id=1]').'</div>';
	}
}
add_action( 'woocommerce_before_shop_loop', 'search_above_shop_loop', 10 );
	

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer