Skip to:
Content
Pages
Categories
Search
Top
Bottom

child theme functions.php

  • Avatar of blg002
    blg002
    Participant

    @blg002

    I’ve created a small custom child theme and was working on some custom functions. According to this step, I am told to rename the functions.php file in my theme folder (e.g. `/wp-content/themes/custom-theme/cutsom-functions.php`). However this does not work. If I move the code into `bp-default/functions.php` it works or if I rename my custom-functions.php to `functions.php` it works. I have done the later and things seem fine but I want to make sure I’m not missing something.

Viewing 1 replies (of 1 total)
  • Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    The step there isn’t really clear.

    By renaming functions, what the codex article means is renaming the function name and not the filename.

    Continue using /wp-content/themes/YOUR-THEME/functions.php. Just try to prefix your function names in this file.

    eg.

    `
    // bad
    function do_crazy_stuff() {

    }`

    `// better
    function my_theme_do_crazy_stuff() {

    }
    `

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.