Error and Notice When Adding Products to Post with Block Editor

Edit: I’m an idiot and have been working on files for the wrong website and plugging it into this one. Please disregard this, many apologies!

Hello, I have a website with blog posts which I would like to add and edit using the Gutenberg block editor. By using the block editor, I can add a block named Hand-picked Products which I can use to showcase products from WooCommerce.

To use the block editor, I went to Settings > Writing and enabled Allow users to switch editor.

However, when I added the block Hand-picked Products, the following notice is shown on the products’ entry header:

Notice: post was called incorrectly. Product properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(’/themes/pro/single.php’), x_get_view, X_View_Router::render, include(’/themes/pro/framework/views/integrity/wp-single.php’), x_get_view, X_View_Router::render, include(’/themes/pro/framework/views/integrity/content.php’), x_get_view, X_View_Router::render, include(’/themes/pro/framework/views/global/_content.php’), x_get_view, X_View_Router::render, include(’/themes/pro/framework/views/global/_content-the-content.php’), the_content, apply_filters(‘the_content’), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, WC_Shortcodes::products, WC_Shortcode_Products->get_content, WC_Shortcode_Products->product_loop, wc_get_template_part, load_template, require(’/plugins/woocommerce/templates/content-product.php’), do_action(‘woocommerce_after_shop_loop_item_title’), WP_Hook->do_action, WP_Hook-> in /home/lpiprivatebrandt/public_html/wp-includes/functions.php on line 4773

In fact, it looks like this error is appearing on all instances of products and the website’s styling seem to be broken. I’m not sure what happened. I checked my custom CSS (stored in Theme Options > Global CSS) and child theme’s functions.php, cannot find any issue.

Edit: I’m an idiot and have been working on files for the wrong website and plugging it into this one. Please disregard this, many apologies!

That’s not an issue. Glad that figured it out. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.