Community Forums › Forums › Archived Forums › Design Tips and Tricks › Site broken after Genesis Custom Code edit
- This topic has 12 replies, 4 voices, and was last updated 10 years, 12 months ago by webmonkey.
-
AuthorPosts
-
April 25, 2013 at 6:13 pm #37752webmonkeyMember
My Prose site is broken after a bad PHP edit to the Custom Functions section of Custom Code (is this added by Genesis or Jetpack?) in the Genesis menu:
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
Where does one find the data that this file stores, to delete the problematic PHP, and thus restore the site? I searched the entire SQL file with no sign of any of the content.April 25, 2013 at 8:48 pm #37769AnitaKeymasterYou may want to check with your host about the 500 error. Or, you can use FTP and upload the original Function file back to your hosting account.
Love coffee, chocolate and my Bella!
April 26, 2013 at 1:56 am #37797Brad DaltonParticipantYep. Just upload a new file from a fresh download of the Prose theme. Hope you have backup or you may a want to download the problem file locally.
I get these errors dozens of times a day testing code. No big deal
April 28, 2013 at 12:31 pm #38245webmonkeyMemberProse doesn't store its Custom Code in the functions.php but it must store it somewhere.
April 28, 2013 at 12:35 pm #38247Brad DaltonParticipantApril 28, 2013 at 12:36 pm #38248webmonkeyMemberThis is what's in the Prose functions.php file
`<?php
/*
WARNING: DO NOT edit this file under any circumstances.
Please do all PHP modifications via the Custom Code admin menu.
*//**
* This file calls the init.php file for both Genesis and Prose.
*
* It initializes the Genesis framework, and loads the Prose library as well.
*
* This file is a core Prose file and should not be edited.
*
* @author StudioPress
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
* @link http://www.studiopress.com/themes/genesis
*//** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );
require_once( get_stylesheet_directory() . '/lib/init.php' );prose_create_custom_php();`
Uploading a new one doesn't change anything. I searched the SQL database for words I knew were in there, but no luck. So where is Prose/Genesis storing the Custom Code you can add through the Genesis menu.
April 28, 2013 at 12:43 pm #38250Brad DaltonParticipantYou need to upload this file custom.php
which is located here lib/structure/custom.php
Send me your login details for cPanel and i'll fix it.
April 28, 2013 at 12:50 pm #38252webmonkeyMemberDoesn't make any difference. That file doesn't store content either:
`<?php
/**
* This file controls the creation and inclusion of the custom.php file.
*
* @package Prose
* @author StudioPress
* @since 1.5.0
*//**
* Return the full path to the custom.php file for editing and inclusion.
*
* @uses prose_get_stylesheet_location()
*
* @since 1.5.0
*
*/
function prose_get_custom_php_path() {return prose_get_stylesheet_location( 'path' ) . 'custom.php';
}
/**
* Helper function that will create custom.php file, if it does not already exist.
*
* @uses prose_get_custom_php_path()
*
* @since 1.5.0
*
*/
function prose_create_custom_php() {if ( file_exists( prose_get_custom_php_path() ) )
return;$handle = @fopen( prose_get_custom_php_path(), 'w' );
@fwrite( $handle, stripslashes( "<?php\n/** Do not remove this line. Edit functions below. */\n" ) );
@fclose( $handle );}
/**
* Helper function that will create custom.php file, if it does not already exist.
*
* @uses prose_get_custom_php_path()
*
* @since 1.5.0
*
*/
function prose_edit_custom_php( $text = '' ) {/** Create file, if it doesn't exist */
if ( ! file_exists( prose_get_custom_php_path() ) )
prose_create_custom_php();/** Now that it exists, write text to that file */
$handle = @fopen( prose_get_custom_php_path(), 'w+' );
@fwrite( $handle, stripslashes( $text ) );
@fclose( $handle );}
add_action( 'after_setup_theme', 'prose_do_custom_php' );
/**
* PHP require the custom.php file, if it exists.
*
* @uses prose_get_custom_php_path()
*
* @since 1.5.0
*
*/
function prose_do_custom_php() {if ( ! is_admin() && file_exists( prose_get_custom_php_path() ) )
require_once( prose_get_custom_php_path() );}`
April 28, 2013 at 5:08 pm #38309wendycholbiMemberProse stores its custom code in wp-content/uploads/prose/ .
Look for the custom.php file in that directory (you may also see custom.css, settings.css, and minified.css). In its pristine unedited state, the only contents of that file should be:
<?php /** Do not remove this line. Edit functions below. */
I love WordPress, Genesis, and the Prose child theme (my complete guide to using Prose is here: SiteSetupKit.com). Say hi on Twitter: @wendycholbi
April 29, 2013 at 12:45 am #38357Brad DaltonParticipantApril 29, 2013 at 2:59 pm #38464webmonkeyMemberWendy you rock. The custom code file is found here: /wp-content/uploads/prose/custom.php
Brad, thanks for chipping in!
April 29, 2013 at 7:24 pm #38487wendycholbiMemberGlad to help. Sounds like you got your site back up, then? (Hooray!)
I love WordPress, Genesis, and the Prose child theme (my complete guide to using Prose is here: SiteSetupKit.com). Say hi on Twitter: @wendycholbi
April 30, 2013 at 12:06 pm #38601webmonkeyMemberYes, it's all win now:
http://66.147.244.62/~grapefr3/Thanks. 🙂
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.