WordPress pages except homepage showing blank
- Categories Website develop
- Date August 30, 2021
Editor: elementor
Theme: manufacturer from Theme forest
Website developing can be a daunting task even with popular CMS such as wordpress. You may experience a blank page issue, where home page still works fine. I will share one of my troubleshooting here.
Turned on the Use the option switch front-end editor loader method.
You can find it in the settings of Elementor in your WordPress Dashboard (see the screenshot below). Enable this option and check if it solved the issue. Go to Elementor > Settings > Advanced.
Enable wordpress debug by add below line to wp-config.php:
define( 'WP_DEBUG', true );
Then refresh the front end page, you may find below:
Uncaught Error: Call to undefined function is_shop() in /public_html/wp-content/themes/manufacturer/header.php:288 Stack trace: #0 /public_html/wp-includes/template.php(730): require_once() #1 /public_html/wp-includes/template.php(676): load_template('/home/chroot/gm...', true, Array) #2 /public_html/wp-includes/general-template.php(48): locate_template(Array, true, true, Array) #3 /public_html/wp-content/themes/manufacturer/single.php(10): get_header() #4 /public_html/wp-includes/template-loader.php(106): include('/home/chroot/gm...')
Find the file /public_html/wp-content/themes/manufacturer/header.php
Go to line 288, you may see a condition code like below:
if(is_shop()) { $shop_page_id = (int)get_option( 'woocommerce_shop_page_id' ); $hide_title = get_post_meta($shop_page_id, 'hide_title', true); }
Well, the function is trying to see if current page is a shop page, then get the theme option and apply. Some developer may developing a website without woocommerce, so this issue happened.
The solution will be:
- Use woocommerce: Install Woocommerce and activate, this issue will automatically be fixed.
- Website without woocommerce: Simply delete the if condition code in 288 will fix this.