skip to Main Content

I have been trying to figure out if it is possible to have a child theme in WordPress without breaking any functions but with no luck, also tried it on my local environment. Is there any work-around to have a name of theme and directory other then "theme-child"?

As an example i have a theme named "twentyfifteen" and if i try to create a child theme any other then "twentyfifteen-child" it seems some functions break in the theme and i’m not sure why.

Any ideas how this is possible?

Tried changing theme name, directory and within the style.css but the theme breaks, with "-child" it works correctly.

2

Answers


  1. You can name the child theme folder anything you want, but in the stylesheet you enqueue you must name the theme "Parent Theme Name Child" (as directed in the WordPress documentation here: https://developer.wordpress.org/themes/advanced-topics/child-themes/)

    The name of the parent theme is "Twenty Fifteen" (not "twentyfifteen"), so your child theme needs to be named "Twenty Fifteen Child" (and the folder can be names anything).

    Login or Signup to reply.
  2. The folder the child theme resides in is independent of the display name you provide in the config for that theme. eg at minimum, your config can look like this

    /*
    Theme Name: My Child Theme Name Here
    Template: parent-theme-folder-name
    Version: 1.0.0
    */
    

    Then your theme folder can be /themes/whatever-you-want

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search