• 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

Site crashed after adding PHP code

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 › Site crashed after adding PHP code

This topic is: not resolved
  • This topic has 6 replies, 2 voices, and was last updated 10 years, 2 months ago by seminolecrew.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • January 31, 2016 at 2:19 pm #177977
    seminolecrew
    Member

    Hello, I was looking online for a way to add social media icons into the navigation bar. After searching for some time, I came across a tutorial located here...

    https://www.youtube.com/watch?v=9O2zuwmkdH8

    That used this code...

    After I went into the functions.php page and added the code to the bottom as was shown, I hit update. The page turned white, and now I can't get to my website. The site is http://www.i5pi.com.

    Can anyone help me on what I need to do get it back up and running? Thank you!

    Corey

    http://www.i5pi.com
    January 31, 2016 at 2:34 pm #177979
    seminolecrew
    Member

    I so went into my function.php file through Dreamweaver, deleted the PHP code, and got the website back up and running. So I am assuming there is some sort of error with this code? If anyone knows the correct code and can fix it, I would appreciate it!

    genesis_register_sidebar( array(
    'id' => 'nav-social-menu',
    'name' => __( 'Nav Social Menu', 'your-theme-slug' ),
    'description' => __( 'This is the nav social menu section.', 'your-theme-slug' ),
    ) );

    add_filter( 'genesis_nav_items', 'sws_social_icons', 10, 2 );
    add_filter( 'wp_nav_menu_items', 'sws_social_icons', 10, 2 );

    function sws_social_icons($menu, $args) {
    $args = (array)$args;
    if ( 'primary' !== $args['theme_location'] )
    return $menu;
    ob_start();
    genesis_widget_area('nav-social-menu');
    $social = ob_get_clean();
    return $menu . $social;
    }

    February 1, 2016 at 9:24 am #178058
    Victor Font
    Moderator

    For one thing, your code above is using curly quotes instead of straight quotes. That will break PHP every time. If that's not the case, then please post your code correctly using the code button.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    February 1, 2016 at 10:32 am #178064
    seminolecrew
    Member

    Victor, sorry, I'm not super knowledgeable when it comes to code. Here is the website I used and the code for the PHP that was referenced in that instructional video.

    Corey

    February 2, 2016 at 3:50 pm #178185
    seminolecrew
    Member

    Don't know why I can't add the URL into the body of the message. So CLICK HERE to see the code I am referring to.

    Corey

    February 4, 2016 at 9:13 pm #178349
    seminolecrew
    Member

    Anyone have any answers as to how I can put the icons in the right side of the nav?????

    February 8, 2016 at 11:45 am #178583
    seminolecrew
    Member

    Since this question isn't being answered, I will have to close this and open up a new thread.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Site crashed after adding PHP code’ is closed to new 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