Child Theme PHP files

Hi! I´ve created a child theme to make all my changes, but for some reason none of the .php files i try to override seemes to work. I´ve copied the entire files, made my changes and put them in the child theme folder in the correct folder structure. But for some reason the theme still loads the original files.

Do you have any idea what might be the problem?

There could be more problems. Your child theme might not work as it should, or you’re trying to overwrite files that can’t be overwritten or cannot be overwritten by simply copying them. If you could be more specific I might be able to help.

Well, I´m using the theme moesia and I have another folder called moesia-child. Inside the child folder I have the style.css which seams to be working perfectly. Inside the child folder I also have a folder named widgets which contains fp-projects.php and fp-latest-news.php. Non of which work. Inside the child folder I also have a folder called js which contains the carousel-init.js file which won’t work either. I have no idea why. Worth mentioning is also that I have the footer.php file directly in the child folder and that seemes to be working alright. So the problem seemes to be with the subdirectories.

This is basically how it looks:

-themes (folder)
  -moesia (theme files)(folder)
  -moesia-child (folder)
    -footer.php (working)
    -style.css (working)
    -js (folder)
      -carousel-init.js (not working)
    -widgets (folder)
      -fp-latest-news.php (not working)
      -fp-projects.php (not working)

However all files (except for the java-script)show up in the wordpress editor.

Now all of a sudden it seems like some things from my syle.css has stopped working. Things that worked but a moment ago.

For instance, this code wont work anymore:

/* Center link-icon and remove zoom-icon from project thumbnails
-------------------------------------------------------------- */
.project-image:hover > .link-icon {
   left: 38%;
}
.pp-icon {
   display: none;
}

While this code seems to be working perfecly:

/* Center Facts
-------------------------------------------------------------- */
.facts-area {
   text-align: center;
}
.facts-area .col-md-3 {
   display: inline-block;
   float: none;
}

It doesn’t work like that. We’re loading widgets and scripts from the parent directory. Footer.php works because WP looks for it in the child theme. Same goes for header.php, page.php etc.

We could change the code to load widgets and scripts from child themes, but I’m pretty sure that will lead to people trying to change things and breaking their websites. We’ll see, maybe we’ll make this change today.

It is possible to overwrite them now also, but you would need to unregister the widgets and re-register them from the child theme with a different class. Same goes for scripts, they need to be dequeued then enqueued from the child theme.

Not sure about the CSS, you might have something wrong there.

Oh alright. I got the impression from some other posts on here that I could do it that way. It would really be appreciated if you made that change since it would make the theme more easily customizable.

I’ll look in to the CSS problem. But it´s really wierd since some code parts just stopped working randomly.

Edit: I belive I found the CSS problem. It seemed to b that I missed the ending ´}´ after a style code. That probably fucked up everything that came after.

I’m having a similar problem with projects.php in a child theme.

Would you be able to walk me through how I

unregister the widgets and re-register them from the child theme with a different class. Same goes for scripts, they need to be dequeued then enqueued from the child theme.

Thanks!