Hello,
I've created two same website under the same server, theme, plugin, etc., but the html of the two website are different.
Compare with the two pictures, and it seems like some codes are missing. Please see the red circle marked on the picture.
With the wrong html, the adminbar can't display properly either.
Could you please help me to check the picture attached?
Hi Waqar,
I'll provide the database and the whole site backup for you to test the problem I've met.
Could you help me turn the ticket to private? Thanks.
Hi,
Sure, we'll be happy to investigate this in more detail.
I've set your next reply as private and it would be more efficient if you could share the website's clone through the Duplicator plugin.
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )
regards,
Waqar
Hi,
Thank you for sharing the duplicator package.
During troubleshooting, I noticed this error in the error log:
PHP Fatal error: Uncaught Error: Call to undefined function wc_get_page_id() in ...\wp-content\themes\oceanwp\inc\breadcrumbs.php:658
The theme seems to be confusing the "Product" custom post type on your website with the one from the WooCommerce plugin and is calling its function "wc_get_page_id". But, since WooCommerce is not active, it results in the fatal error and breaks the single product page.
As a quick fix, you can remove or comment out these lines from the theme's file "wp-content\themes\oceanwp\inc\breadcrumbs.php" starting at line# 653:
// If the post type is 'product'.
else if ( 'product' === $post->post_type
&& 'none' != $products_tax ) {
if ( 'shop' == $products_tax ) {
$shop_id = wc_get_page_id( 'shop' );
$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $shop_id ) ), get_the_title( $shop_id ) );
} else {
$this->add_post_terms( $post_id, $products_tax );
}
}
For a proper fix, you can report this bug to the "OceanWP" theme's support, so that it can be fixed in future releases.
regards,
Waqar
My issue is resolved now. Thank you!