Title: Functions.php in child theme &#8211; need syntax
Last modified: August 20, 2016

---

# Functions.php in child theme – need syntax

 *  [swarmofbees](https://wordpress.org/support/users/swarmofbees/)
 * (@swarmofbees)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/functionsphp-in-child-theme-need-syntax/)
 * I’ve been trying to get RSS feeds to display entire posts on external site embeds,
   and someone kindly pointed me to twentyeleven_excerpt_length in functions.php.
   I changed it from the default “40” (words) to “500”, which is more than I’ll 
   ever need, and it works fine – posts are no longer truncated.
 * However, for that change to survive the next theme update I’ll need to move it
   to the child theme, of course. The comment-text in functions.php tells me how,
   but I don’t know the file layout well enough to know if I’m doing it slightly
   wrong.
 * I had a go, anyway. Here’s the entire text of functions.php in my child theme,
   it doesn’t currently work.
 *     ```
       <?php
   
       function new_excerpt_length($length) {
       return 500;
       }
       add_filter('excerpt_length', 'new_excerpt_length');
   
       ?>
       ```
   
 * I know this is probably a really simple formatting problem – I’ve just no idea
   where to start, or what obvious thing I need to include.

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/functionsphp-in-child-theme-need-syntax/#post-2733975)
 * That part looks right. Something else must be wrong.
 * Does your child theme show as the current theme in the dashboard?
 *  [govpatel](https://wordpress.org/support/users/govpatel/)
 * (@govpatel)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/functionsphp-in-child-theme-need-syntax/#post-2733977)
 * You will need your style.css file in child theme as well
    [http://codex.wordpress.org/Child_Themes#The_required_style.css_file](http://codex.wordpress.org/Child_Themes#The_required_style.css_file)
 *  Thread Starter [swarmofbees](https://wordpress.org/support/users/swarmofbees/)
 * (@swarmofbees)
 * [14 years ago](https://wordpress.org/support/topic/functionsphp-in-child-theme-need-syntax/#post-2734138)
 * Sorry for not replying before, I got this thread muddled with another one and
   thought it had been closed. *is new here*
 * Vtxyzzy: Yes, it does. In all other aspects, my child theme is active and functioning
   fine.
 * Govpatel: I’ve got that, it was the first thing I had. I’ve had no hitches with
   the child theme until this part.
 * Well, all in all, it’s nice to know there’s nothing egregiously wrong with my
   code, but it makes its current nonworking state all the more puzzling. :O
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [14 years ago](https://wordpress.org/support/topic/functionsphp-in-child-theme-need-syntax/#post-2734139)
 * I think the filter you are using only applies to Posts, Pages, etc, not to feeds.
 * Can you do what you want by going to Admin->Settings->Reading and choosing ‘Full
   text’ radio button for ‘For each article in a feed, show’?
 *  Thread Starter [swarmofbees](https://wordpress.org/support/users/swarmofbees/)
 * (@swarmofbees)
 * [14 years ago](https://wordpress.org/support/topic/functionsphp-in-child-theme-need-syntax/#post-2734140)
 * *nod* That was one of the first things I tried; I only tried monkeying around
   with functions.php when none of the in-admin-screen settings seemed to do anything.
 * I get the impression that with this kind of thing, there’s endless contradictory
   instructions overwriting each other; but functions.php seemed to be the one all
   the others listen to. It works, in the parent theme; I’m just concerned with 
   moving the relevant bit of code to the child theme, so updates won’t wipe it 
   and stick me back with the 40-word limit.
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [14 years ago](https://wordpress.org/support/topic/functionsphp-in-child-theme-need-syntax/#post-2734141)
 * If that works in the parent theme, it should work in the child theme as well.
   Something else may be wrong.
 * To be sure that the function is being called, put in a debugging statement like
   this:
 *     ```
       <?php
   
       function new_excerpt_length($length) {
          print_r('<h2>DEBUGGING new_excerpt_length</h2>');
       return 500;
       }
       add_filter('excerpt_length', 'new_excerpt_length');
   
       ?>
       ```
   

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

The topic ‘Functions.php in child theme – need syntax’ is closed to new replies.

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [RSS](https://wordpress.org/support/topic-tag/rss/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/functionsphp-in-child-theme-need-syntax/#post-2734141)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
