Title: Code won&#039;t work in Child Theme Functions.php
Last modified: September 1, 2016

---

# Code won't work in Child Theme Functions.php

 *  [Rapforthemoment](https://wordpress.org/support/users/rapforthemoment/)
 * (@rapforthemoment)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/code-wont-work-in-child-theme-functionsphp/)
 * I am editing this php file here: [http://pastebin.com/VuH3C1XH](http://pastebin.com/VuH3C1XH)
 * **Line 54**. I need to replace this line with this code:
 *     ```
       <?php if (is_user_logged_in ()): ?>
           <?php
               $current_user = wp_get_current_user ();
               echo get_avatar ($current_user->user_email, 100);
           ?>
       <?php else: ?>
           <img src="http://richtrix.com/wp-content/uploads/2016/07/Register.jpg" alt="No avatar is available" />
       <?php endif; ?>
       ```
   
 * I edited this on my parent theme (bad, I know) and the changes worked perfectly.
   I undid the changes and went to my child theme to implement this edit.
 * Problem is, no matter how I edit my child theme functions.php, my website breaks
   down. Can someone please assist me in the correct way to make this edit?
 * I would be so grateful! I am driving myself insane trying to do this.
 * Jeff Arnold

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

 *  [Hardeep Asrani](https://wordpress.org/support/users/hardeepasrani/)
 * (@hardeepasrani)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/code-wont-work-in-child-theme-functionsphp/#post-7558416)
 * Hi Jeff,
 * It appears you’re using a commercial theme so please go to their official support
   channel. In order to be good stewards of the WordPress community, and encourage
   innovation and progress, we feel it’s important to direct people to those official
   locations.
 * Product support URL: [http://theme.co/x/support/](http://theme.co/x/support/)
 * Forum volunteers are also not given access to commercial products, so they would
   not know why your commercial theme or plugin is not working properly. This is
   one other reason why volunteers forward you to the commercial product’s vendors.
   The vendors are responsible for supporting their commercial product.
 * Hope you understand. 🙂
 *  Thread Starter [Rapforthemoment](https://wordpress.org/support/users/rapforthemoment/)
 * (@rapforthemoment)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/code-wont-work-in-child-theme-functionsphp/#post-7558419)
 * I understand completely. I figured I would start out on here before I asked my
   theme support. Thank you for the help though!
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/code-wont-work-in-child-theme-functionsphp/#post-7558422)
 * from what template file is the original code?
 * generally, you can only more or less use pluggable functions, filters, and actions
   in functions.php of a child theme.
 *  Thread Starter [Rapforthemoment](https://wordpress.org/support/users/rapforthemoment/)
 * (@rapforthemoment)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/code-wont-work-in-child-theme-functionsphp/#post-7558427)
 * It lies within superfly-menu.php which is a plugin that came bundled with my 
   theme XTheme. Thank you Michael for joining in on the conversation!
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/code-wont-work-in-child-theme-functionsphp/#post-7558437)
 * it really sounds as if the theme’s developer is the best to contact with your
   question.
 *  Thread Starter [Rapforthemoment](https://wordpress.org/support/users/rapforthemoment/)
 * (@rapforthemoment)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/code-wont-work-in-child-theme-functionsphp/#post-7558438)
 * Thank you for your input! I have contacted them and am awaiting their response!

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

The topic ‘Code won't work in Child Theme Functions.php’ is closed to new replies.

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [function.php](https://wordpress.org/support/topic-tag/function-php/)
 * [parent theme](https://wordpress.org/support/topic-tag/parent-theme/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [Rapforthemoment](https://wordpress.org/support/users/rapforthemoment/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/code-wont-work-in-child-theme-functionsphp/#post-7558438)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
