Title: editing functions.php results in Parse error:
Last modified: August 31, 2016

---

# editing functions.php results in Parse error:

 *  [Markb](https://wordpress.org/support/users/terasolar/)
 * (@terasolar)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/editing-functionsphp-results-in-parse-error/)
 * Hi there,
 * I am running a site with a storefront child theme and whenever I add code to 
   the funtions.php file it results in:Parse error: syntax error…storefront-child/
   functions.php on line 16
 * I can fix this but why won’t it work?
 * The code I was trying to add is below – I am adding this code above the
    // END
   ENQUEUE PARENT ACTION;
 * and have used the plugin ‘Child Theme configurator by Lilaea
 * any help would be greatly appreciated!
 * Mark
    +++++++++++++++++
 *     ```
       <?php
       /**
        * Adds a top bar to Storefront, before the header.
        */
       function storefront_add_topbar() {
           ?>
           <div id="topbar">
               <div class="col-full">
                   <p>Your text here</p>
               </div>
           </div>
           <?php
       }
       add_action( 'storefront_before_header', 'storefront_add_topbar' );
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/editing-functionsphp-results-in-parse-error/#post-6979674)
 * Are you adding this to the bottom of your `functions.php` file?
    If so, there
   should be no space underneath the last line of code… `add_action( 'storefront_before_header','
   storefront_add_topbar' );` …and no closing tag “`?>`“
 * Put it underneath “// END ENQUEUE PARENT ACTION;” with a space between.
 * And if this is in your functions.php…
    +++++++++++++++++ …remove it.
 *  Thread Starter [Markb](https://wordpress.org/support/users/terasolar/)
 * (@terasolar)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/editing-functionsphp-results-in-parse-error/#post-6979713)
 * Hi there,
 * Thanks for getting back.
 * Can you confirm that this is correct?
 *     ```
       endif;
       add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' );
   
       <?php
       /**
       * Adds a top bar to Storefront, before the header.
       */
       function storefront_add_topbar() {
       ?>
       <div id="topbar">
       <div class="col-full">
       <p>Your text here</p>
       </div>
       </div>
       <?php
       }
       add_action( 'storefront_before_header', 'storefront_add_topbar' );
       // END ENQUEUE PARENT ACTION
   
       ?>
       ```
   
 * [Moderator note: code fixed. Please wrap code in the backtick character or [use the code button](https://codex.wordpress.org/Forum_Welcome#Posting_Code).]
 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [10 years, 4 months ago](https://wordpress.org/support/topic/editing-functionsphp-results-in-parse-error/#post-6979725)
 * Hi there!
 * Taking a quick look over the error message it would sound like you are using 
   a child theme of storefront, correct? If that is so: AWESOME!!
 * With that in mind would you mind posting the first 20 lines of your functions
   file?
 *  [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/editing-functionsphp-results-in-parse-error/#post-6979729)
 * Not quite…
 *     ```
       endif;
       add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' );
       // END ENQUEUE PARENT ACTION
   
       /**
       * Adds a top bar to Storefront, before the header.
       */
       function storefront_add_topbar() {
       ?>
       <div id="topbar">
       <div class="col-full">
       <p>Your text here</p>
       </div>
       </div>
       <?php
       }
       add_action( 'storefront_before_header', 'storefront_add_topbar' );
       ```
   
 * **No** space underneath the last line of code…
    `add_action( 'storefront_before_header','
   storefront_add_topbar' );` …and **No** closing tag “`?>`”
 *  Thread Starter [Markb](https://wordpress.org/support/users/terasolar/)
 * (@terasolar)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/editing-functionsphp-results-in-parse-error/#post-6979734)
 * Hi there,
 * thanks again… that was my 2nd choice!
 * I’ll give it a try and if there are any other questions I’ll back to you.
 * Cheers,
 * Mark

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘editing functions.php results in Parse error:’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [Markb](https://wordpress.org/support/users/terasolar/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/editing-functionsphp-results-in-parse-error/#post-6979734)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
