Community Forums › Forums › Archived Forums › Design Tips and Tricks › White page of death Outreach Pro – front-page.php issue
- This topic has 16 replies, 4 voices, and was last updated 9 years, 8 months ago by
Becky Lundin.
-
AuthorPosts
-
August 22, 2015 at 7:54 pm #163206
Becky Lundin
ParticipantI have ended up with the "White Page of Death" on my clients site when I updated everything. I've narrowed it down to the front-page.php file, but can't figure out why my added code is breaking it, when it worked perfect before. I just updated WP, Genesis, and Outreach Pro. As long as I just use the front-page.php code that comes with the theme it works fine.
The front page code that I added is for 2 extra widgets:
//* Add extra home bottom widgets
add_action( 'genesis_before_footer', 'outreach_extra_home_bottom_widgets', 1 )//* Add extra home bottom widgets 1
add_action( 'genesis_before_footer', 'outreach_extra_home_bottom_widgets-1', 4 )//* Add home bottom widgets
add_action( 'genesis_before_footer', outreach_home_bottom_widgets', 3 );function outreach_extra_home_bottom_widgets() {
genesis_widget_area( 'extra-home-bottom', array(
'before' => '<div class="extra-home-bottom widget-area">',
'after' => '</div>',
) );}
function outreach_extra_home_bottom_widgets_1() {genesis_widget_area( 'extra-home-bottom-1', array(
'before' => '<div class="extra-home-bottom-1 widget-area">',
'after' => '</div>',
) );}
The site is: http://mountrainierspa.com/
You can see how it used to look here: https://web.archive.org/web/20141218044737/http://mountrainierspa.com/
Any help greatly appreciated!
http://mountrainierspa.com/August 22, 2015 at 8:30 pm #163209Victor Font
ModeratorWhere are you registering the widget areas? You can't initialize widget areas in front-page unless you've registered them first in functions.php. Chances are good that you overwrote functions.php when you updated Outreach Pro.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?August 23, 2015 at 11:22 am #163236Becky Lundin
ParticipantHi Victor. Thanks for the reply.
I should have added that yes, the widget areas are registered in functions.php. I did have to reload my file since as you noted they were overwritten when I updated Outreach Pro.
All of the coding is exactly the same, which is why I don't understand why it is not working.
Would it be helpful for me to list the functions.php code that I added here to be looked at?
Thanks again! 🙂
August 24, 2015 at 7:32 am #163297Victor Font
ModeratorYes, it would be helpful. Also, when you post code in these relies, mark them as code from the menu button. Highlight the code and click the button. This way your code retains its formatting. When you just copy and paste code into these replies, the system changes straight quotes to curly quotes. Curly quotes will break php every time.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?August 24, 2015 at 5:36 pm #163354Becky Lundin
ParticipantVictor - these are the theme functions.php that I added:
//* Register widget areas genesis_register_sidebar( array( 'id' => 'extra-home-bottom', 'name' => __( 'Extra - Home - Bottom', 'custom' ), 'description' => __( 'This is the extra bottom section of the Home page.', 'custom' ), ) ); genesis_register_sidebar( array( 'id' => 'extra-home-bottom-1', 'name' => __( 'Extra - Home - Bottom - 1', 'custom' ), 'description' => __( 'This is the extra bottom section of the Home page.', 'custom' ), ) );
This is the entire coding for the front-page.php that gives it the white screen of death:
<?php /** * This file adds the Home Page to the Outreach Pro Theme. * * @author StudioPress * @package Outreach Pro * @subpackage Customizations */ add_action( 'genesis_meta', 'outreach_home_genesis_meta' ); /** * Add widget support for homepage. If no widgets active, display the default loop. * */ function outreach_home_genesis_meta() { if ( is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-bottom' ) ) { //* Force full-width-content layout setting add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); //* Add outreach-pro-home body class add_filter( 'body_class', 'outreach_body_class' ); //* Remove breadcrumbs remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); //* Remove the default Genesis loop remove_action( 'genesis_loop', 'genesis_do_loop' ); //* Add home top widgets add_action( 'genesis_loop', 'outreach_home_top_widgets' ); //* Add extra home bottom widgets add_action( 'genesis_before_footer', 'outreach_extra_home_bottom_widgets', 1 ); //* Add extra home bottom widgets 1 add_action( 'genesis_before_footer', 'outreach_extra_home_bottom_widgets-1', 4 ); //* Add home bottom widgets add_action( 'genesis_before_footer', outreach_home_bottom_widgets', 3 ); } } function outreach_body_class( $classes ) { $classes[] = 'outreach-pro-home'; return $classes; } function outreach_home_top_widgets() { genesis_widget_area( 'home-top', array( 'before' => '<div class="home-top widget-area">', 'after' => '</div>', ) ); } function outreach_extra_home_bottom_widgets() { genesis_widget_area( 'extra-home-bottom', array( 'before' => '<div class="extra-home-bottom widget-area">', 'after' => '</div>', ) ); } function outreach_home_bottom_widgets() { genesis_widget_area( 'home-bottom', array( 'before' => '<div class="home-bottom widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); } function outreach_extra_home_bottom_widgets_1() { genesis_widget_area( 'extra-home-bottom-1', array( 'before' => '<div class="extra-home-bottom-1 widget-area">', 'after' => '</div>', ) ); } genesis();
When I take the following code out, then the site works, but not the custom widgets of course:
//* Add extra home bottom widgets add_action( 'genesis_before_footer', 'outreach_extra_home_bottom_widgets', 1 ); //* Add extra home bottom widgets 1 add_action( 'genesis_before_footer', 'outreach_extra_home_bottom_widgets-1', 4 );
August 24, 2015 at 6:34 pm #163359Brad Dalton
ParticipantChange debug to TRUE in wp-config.php which will give you the error and line number.
August 24, 2015 at 9:32 pm #163366Becky Lundin
ParticipantThanks Brad. I changed it to "true", but not sure what to do next. How do I get the error and line number?
I am not a programmer, obviously. 😉
August 24, 2015 at 9:57 pm #163382coralseait
MemberThe problem is here:
//* Add home bottom widgets add_action( 'genesis_before_footer', outreach_home_bottom_widgets', 3 );
At the end of your outreach_home_genesis_meta function, If that is exactly what front-page.php looks like.
You are missing a single quote starting around outreach_home_bottom_widgets',3 );
It should be:
//* Add home bottom widgets add_action( 'genesis_before_footer', 'outreach_home_bottom_widgets', 3 );
August 25, 2015 at 12:03 am #163391Brad Dalton
ParticipantReload the page and it will give you the error which @coralseait has picked up.
August 25, 2015 at 12:47 am #163393Becky Lundin
ParticipantThanks Coral Sea - good eyes! 🙂
I fixed that (I probably forgot to correct my old backup file on my computer when I was originally building the site), but when I loaded the corrected version I still get the white page of death.
This site, with that coding, worked perfect for months. http://mountrainierspa.com/
I can't figure out why it won't accept that code. I can leave the site as it is, but I had the custom widgets working fine before, and there is a sister site to this one with the same issue.
August 25, 2015 at 12:49 am #163394Becky Lundin
ParticipantThanks Brad - I put the code for the extra widget areas back up and still getting white page with no error message. I'll have to play with it more tomorrow.
Appreciate everyone's time on this. 🙂
August 25, 2015 at 12:53 am #163395coralseait
MemberDepending on your host / environment there should be an error.log or similar type file in your installation somewhere. Probably in your wp root / html_public folder. If you are on a host that uses cPanel you can dig around and find it.
With debug true, you'll find entries near the bottom of the file corresponding to the problem.
August 25, 2015 at 4:15 am #163402Victor Font
ModeratorYour function is named outreach_extra_home_bottom_widgets_1. In your add_action code, you are calling outreach_extra_home_bottom_widgets-1. Change the dash to an underscore.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?August 25, 2015 at 11:08 pm #163524Becky Lundin
ParticipantThanks coralseait - I'll check it out tomorrow. Appreciate your time.
August 25, 2015 at 11:09 pm #163525Becky Lundin
ParticipantThanks Victor. That had been corrected - I just pulled up the old file when I posted it here. Good eyes though - and I sure appreciate your time!
August 26, 2015 at 7:44 am #163564Victor Font
ModeratorI refactored your code a little bit. It runs in my local environment without error:
function outreach_home_genesis_meta() { if ( is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-bottom' ) || is_active_sidebar('extra-home-bottom') || is_active_sidebar('extra-home-bottom-1') ) { //* Force full-width-content layout setting add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); //* Add outreach-pro-home body class add_filter( 'body_class', 'outreach_body_class' ); //* Remove breadcrumbs remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); //* Remove the default Genesis loop remove_action( 'genesis_loop', 'genesis_do_loop' ); //* Add home top widgets add_action( 'genesis_loop', 'outreach_home_top_widgets' ); //* Add home bottom widgets add_action( 'genesis_before_footer', 'outreach_home_bottom_widgets', 1 ); } } function outreach_body_class( $classes ) { $classes[] = 'outreach-pro-home'; return $classes; } function outreach_home_top_widgets() { genesis_widget_area( 'home-top', array( 'before' => '<div class="home-top widget-area">', 'after' => '</div>', ) ); } function outreach_home_bottom_widgets() { genesis_widget_area( 'extra-home-bottom', array( 'before' => '<div class="extra-home-bottom widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'extra-home-bottom-1', array( 'before' => '<div class="extra-home-bottom-1 widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'home-bottom', array( 'before' => '<div class="home-bottom widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?August 31, 2015 at 12:24 am #164091Becky Lundin
ParticipantThank you everyone for your help. Even deleting Genesis and Outreach Pro, and reinstalling and activating them, without putting in my custom code, the site keeps going to the white screen after a while. I'm thinking it is a plug in issue that is corrupting the code. I have turned this over to someone else to figure out.
I really appreciate all the tips and help!
I'll mark this thread as resolved.
-
AuthorPosts
- The topic ‘White page of death Outreach Pro – front-page.php issue’ is closed to new replies.