• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Crave theme – yes, a Community theme but editing functions.php crashes site

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Crave theme – yes, a Community theme but editing functions.php crashes site

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 13 years, 5 months ago by MissKitty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • May 30, 2013 at 2:44 pm #43259
    MissKitty
    Participant

    Purchased, downloaded and installed Crave child theme. Wanted to add a header right widget, so followed instructs on Pixelista's support forum

    http://thepixelista.com/forums/topic/header-widget/

    When I edited the child functions file, the site crashed, with this error:

    Parse error: syntax error, unexpected T_STRING in /home/content/53/7446153/html/ahhquabedandbreakfast.com/wp-content/themes/crave/functions.php on line 1

    Ok, no problem- I'll just replace the functions file w/ original functions file -

    Site is still crashed, with same error, even though I replaced the functions file with the original version.

    I tested on other hosting servers with same results. Godaddy, Innohosting.

    I've posted on Pixelista's support forum, but I HAVE to keep moving forward on this site AND I have to be able to safely edit the functions file (not just for header widgets but registering new sidebars).

    I'm sure there are no solutions to be found here, but suggestions?

    tx in advance.

    http://ahhquabedandbreakfast.com
    May 30, 2013 at 6:35 pm #43277
    Brad Dalton
    Participant

    You may be missing the opening PHP tag which you need.

    <?php
    

    Tutorials for StudioPress Themes.

    May 30, 2013 at 7:17 pm #43283
    MissKitty
    Participant

    Thank you, Braddalton - that doesn't seem to be the case.

    Even when I replaced the native php file, the issue persisted, so I've abandoned this theme and moved on. FWIW, here's the native php file content:

    <?php

    /**
    * Custom amendments for the theme.
    *
    * @category   Crave
    * @package    Functions
    * @subpackage Functions
    * @author     Jessica Barnard
    * @license    http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
    * @link       http://thepixelista.com/themes/crave/
    * @since      1.0.0
    *
    */

    add_action( 'genesis_setup', 'crave_theme_setup', 15 );
    /**
    * Theme Setup
    * @since 1.0.0
    * @link https://github.com/surefirewebserv/Genesis-Sandbox/blob/Empty-Sandbox/functions.php
    * @link https://github.com/billerickson/BE-Genesis-Child/blob/master/functions.php
    *
    * This setup function attaches all of the site-wide functions
    * to the correct hooks and filters. All the functions themselves
    * are defined below this setup function.
    */
    function crave_theme_setup() {

    /** Child theme (do not remove) */
    define( 'CHILD_THEME_NAME', __( 'Crave Theme', 'crave' ) );
    define( 'CHILD_THEME_VERSION', '1.0.1' );
    define( 'CHILD_THEME_URL', 'http://thepixelista.com/themes/crave' );
    define( 'CHILD_THEME_DEVELOPER', __( 'The Pixelista', 'crave' ) );

    /**    Add Viewport meta tag for mobile browsers */
    add_action( 'genesis_meta', 'sample_viewport_meta_tag' );

    /**    Set content width */
    $content_width = apply_filters( 'content_width', 610, 610, 980 );

    /**     Add Images Sizes */
    add_image_size( 'featured-x-large', 1000, 669, TRUE );
    add_image_size( 'featured-large', 650, 435, TRUE );
    add_image_size( 'featured-medium', 295, 196, TRUE );
    add_image_size( 'featured-small', 190, 127, TRUE );

    /**
    * Add Style Selector
    */
    add_theme_support(
    'genesis-style-selector',
    array(
    'crave-citrus' => __( 'Citrus', 'crave' ),
    'crave-berry'  => __( 'Berry', 'crave' ),
    )
    );

    /**    Structural Wraps */
    add_theme_support(
    'genesis-structural-wraps',
    array(
    'header',
    'nav',
    'subnav',
    'inner',
    'footer-widgets',
    'footer',
    )
    );

    /**    Layouts     */
    genesis_set_default_layout( 'content-sidebar' );
    foreach ( array( 'content-sidebar-sidebar', 'sidebar-sidebar-content', 'sidebar-content-sidebar', ) as $layout )
    genesis_unregister_layout( $layout );

    /**    Genesis Menus  */
    add_theme_support( 'genesis-menus', array( 'primary' => 'Primary Navigation Menu' ) );

    remove_action( 'genesis_after_header', 'genesis_do_nav' );
    add_action( 'genesis_before_header', 'genesis_do_nav' );

    /**    Sidebars  */
    unregister_sidebar( 'header-right' );
    unregister_sidebar( 'sidebar-alt' );
    crave_sidebars();

    /**    Search Text  */
    add_filter( 'genesis_search_text', '__return_null' );

    /** Add Google Fonts: Rokkitt:700, Open+Sans:700,400, Sanchez:400,400italic */
    add_action( 'wp_enqueue_scripts', 'crave_load_google_fonts' );

    /** Customize Read More */
    add_filter( 'excerpt_more', 'crave_read_more_link' );
    add_filter( 'get_the_content_more_link', 'crave_read_more_link' );
    add_filter( 'the_content_more_link', 'crave_read_more_link' );

    /** Remove Back to top */
    add_filter( 'genesis_footer_backtotop_text', '__return_null' );

    /** Customize Credits Footer Text */
    add_filter( 'genesis_footer_creds_text', 'crave_footer_creds_text', 12 );

    /** Modify the size of the Gravatar in the author box */
    add_filter( 'genesis_author_box_gravatar_size', 'crave_author_box_gravatar_size' );

    /** Modify the author box title */
    add_filter( 'genesis_author_box_title', 'author_box_title' );
    }

    /**
    * Load Genesis
    *
    * This is technically not needed. However, to make functions.php snippet useful, it is necessary.
    */
    require_once( get_template_directory() . '/lib/init.php' );

    /** All Done! Loaded! Happy editing! */
    /*******************************************************************************/

    /**    Add Viewport meta tag for mobile browsers */
    function sample_viewport_meta_tag() {
    echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
    }

    /**    Modify the size of the Gravatar in the author box  */
    function crave_author_box_gravatar_size( $size ) {
    return 100;
    }

    /**    Modify the author box title  */
    function author_box_title() {
    return '<h3>About the Author</h3>';
    }

    /**
    * Edit excerpt read more link
    *
    * @param  string $more Read More Text, , default: ' ' . '[...]'
    * @return string Modified Read More Text.
    */
    function crave_read_more_link( $text ) {
    return sprintf(
    '…  <span class="crave-read-more"><a href="%s" rel="nofollow">%s</a></span>',
    get_permalink(),
    __( ' [read more]', 'crave' )
    );
    }

    /**
    * Registers sidebars for Crave theme.
    *
    * @since 1.0.0
    */
    function crave_sidebars() {
    genesis_register_sidebar(
    array(
    'id'            => 'home-top',
    'name'            => __( 'Home Top', 'crave' ),
    'description'    => __( 'This is the home top section.', 'crave' ),
    )
    );
    genesis_register_sidebar(
    array(
    'id'            => 'home-middle',
    'name'            => __( 'Home Middle', 'crave' ),
    'description'    => __( 'This is the home middle section.', 'crave' ),
    )
    );
    genesis_register_sidebar(
    array(
    'id'            => 'home-bottom',
    'name'            => __( 'Home Bottom', 'crave' ),
    'description'    => __( 'This is the home bottom section.', 'crave' ),
    )
    );
    }

    /**
    * Customize the Credits Text
    *
    * @param string $creds_text Default Credits.
    * @return string Modified Pixelista Credits.
    */
    function crave_footer_creds_text( $creds_text ) {
    return sprintf(
    '[footer_copyright before="%s "] | [footer_childtheme_link before=""] %s <a href="http://thepixelista.com">%s</a> | %s [footer_genesis_link url="http://www.studiopress.com/" before=""]',
    __( 'Copyright', 'crave' ),
    __( 'by', 'crave' ),
    CHILD_THEME_DEVELOPER,
    __( 'Built on the ', 'crave' )
    );

    }

    /**
    * Enqueue Google fonts
    */
    function crave_load_google_fonts() {
    wp_enqueue_style(
    'crave-google-fonts',
    'http://fonts.googleapis.com/css?family=Rokkitt:700|Open+Sans:700,400|Sanchez:400,400italic',
    array(),
    CHILD_THEME_VERSION
    );
    }

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble