change function in theme-function.php using a child theme

  • Author
    Posts
  • #22046
    Jan

    Hi there,

    first of all, thank you for the great theme! I just have a small problem and would like your input on it.

    I needed to change a function in theme-function.php. No big deal, works fine. But since I decided to use a child theme in order to keep it clean and easy to update I couldn’t find a way to “override” the function.

    Is there a way to change / override a function using a child theme without modifying the parent theme? Otherwise I feel like, I’m losing the purpose of the whole child theme thing.

    Thank you for any advise!

    Jan

    #24280
    David

    I’m pretty much a WordPress newbie, so anything I offer may be wrong. Nonetheless, I wanted to make a change to the presentation page layout and found, within my mantra-child directory, an ‘includes’ directory containing theme-frontpage.php. ‘includes’ did not contain any other files, but if edits to includes/theme-frontpage.php would work, I’d THINK you could duplicate theme-function.php there.

    However, when I edited theme-frontpage.php, it didn’t result in any changes to the site, so…?

    #24918
    David G

    I would suggest creating a child-theme for your site. You will have 2 files in the directory – Style.css and functions.php. Then you can edit those to override the theme functions and styles. One benefit of a child theme is that when you update the main theme, you do not lose the customizations you have created. I suggest going to the WP site and search how to create a child-theme. It isn’t hard and there are plugins you can use also to achieve your goals. I use the plugin (Child Themify) but it doesn’t create the functions.php file although that is easy enough using a FTP program to add that.
    I hope that helps.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘change function in theme-function.php using a child theme’ is closed to new replies.