Title: editing php in child theme
Last modified: August 22, 2016

---

# editing php in child theme

 *  Resolved [ohorses](https://wordpress.org/support/users/ohorses/)
 * (@ohorses)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/)
 * I was given directions on how the make a change to a php section but when I switched
   to a child theme, most of the html code is missing.
 * Looks like all we can edit is css.

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

 *  [martcol](https://wordpress.org/support/users/hotmale/)
 * (@hotmale)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/#post-5799292)
 * If you want to add php code to functions.php then you have to create the file
   first.
 * If you want to make a change to another template file then copy that file to 
   your child theme and make the edits to the copied file.
 *  Thread Starter [ohorses](https://wordpress.org/support/users/ohorses/)
 * (@ohorses)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/#post-5799302)
 * Seems to make sense, I’ll keep you posted..thanks.
 *  Thread Starter [ohorses](https://wordpress.org/support/users/ohorses/)
 * (@ohorses)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/#post-5799316)
 * BUT..is there a way to make the above noted php change in css instead?
 *  [SomewhatRounded](https://wordpress.org/support/users/somewhatrounded/)
 * (@somewhatrounded)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/#post-5799318)
 * The css is the only file *needed* for a child theme, and if you’d be able to 
   make the change with css instead of php would entirely depend on what you’re 
   trying to change (it’s very likely not possible).
 * If it’s a template that you’d like to alter, you can copy the file over from 
   the parent theme and make the change (any file, of the same name, in the child
   theme would override the file in the parent theme) 🙂
 *  Thread Starter [ohorses](https://wordpress.org/support/users/ohorses/)
 * (@ohorses)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/#post-5799324)
 * Trying to get specified category to display on home page; was told:
    replace 
   this line $args = array( ‘post_type’ => ‘post’,’posts_per_page’ => 6);
 * to this
    $args = array( ‘post_type’ => ‘post’,’category_name’=>’example’, ‘posts_per_page’
   => 3);
 * where example is your category name.
 * The theme has build in css editor so no worry about future updates erasing everything…
 * If I now install a child theme, some things will get lost..hence the desire to
   use css.??
    .
 *  [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/#post-5799455)
 * [@ohorses](https://wordpress.org/support/users/ohorses/)
 * Thanks for given solution.
 * Thanks
 *  Thread Starter [ohorses](https://wordpress.org/support/users/ohorses/)
 * (@ohorses)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/#post-5799456)
 * When I try to copy the file, the option I get is “copy link location”..I tried
   it in the wp dashboard and on ftp – same choice, so how to I “copy the file”?
 *  [Weblizar – WordPress Themes & Plugin](https://wordpress.org/support/users/weblizar/)
 * (@weblizar)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/#post-5799458)
 * Hi
 * You can upload the file via FTP
 * Replace existing file with new file.
 * Thanks
 *  Thread Starter [ohorses](https://wordpress.org/support/users/ohorses/)
 * (@ohorses)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/#post-5799541)
 * So, – using Filezilla, it’s not a case of copying the file, it’s a case of “downloading”
   it to the computer side and then uploading the file to the new child theme..then
   making the changes via “edit plugin”.
 * Thank, to all who helped.

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

The topic ‘editing php in child theme’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/enigma/7.73/screenshot.png)
 * Enigma
 * [Support Threads](https://wordpress.org/support/theme/enigma/)
 * [Active Topics](https://wordpress.org/support/theme/enigma/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/enigma/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/enigma/reviews/)

 * 9 replies
 * 4 participants
 * Last reply from: [ohorses](https://wordpress.org/support/users/ohorses/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/editing-php-in-child-theme/#post-5799541)
 * Status: resolved