• Resolved ohorses

    (@ohorses)


    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)
  • 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

    (@ohorses)

    Seems to make sense, I’ll keep you posted..thanks.

    Thread Starter ohorses

    (@ohorses)

    BUT..is there a way to make the above noted php change in css instead?

    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

    (@ohorses)

    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.??
    .

    @ohorses

    Thanks for given solution.

    Thanks

    Thread Starter ohorses

    (@ohorses)

    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”?

    Hi

    You can upload the file via FTP

    Replace existing file with new file.

    Thanks

    Thread Starter ohorses

    (@ohorses)

    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.