Weird functions.php Issue

  • Unknown's avatar

    So, first off. I’m pretty sure this isn’t a theme issue that’s why I’m writing here.

    I have a parent and child theme.
    In the child themes functions.php I have this
    require_once( dirname( __FILE__ ) . ‘/filepath/filepath.php’ );

    This Used to be in the Parent theme functions and worked perfectly but would get removed when theme is updated. So I moved it to the Child theme. Now, the Folder Im referring to is IN the child theme but the website was all janky so I checked it out and it appears it’s not grabbing the css that’s supposed to be grabbed.

    So I did some tests and after a few hours one of my tests bore fruit.

    I copied the folder I was calling and pasted it into the Parent theme. Voila it worked!
    But still wasn’t what I wanted. I proceeded with the test and deleted it from my child theme. So the code was in my child functions but the file was in the Parent.

    It didn’t work. The site broke again.

    So I reverted it back and put the Folders in both locations Parent and Child. It worked again. I removed it from the Parent and tried it. Didn’t work.

    So it appears the line of code is only working if the folder is in BOTH places, Parent AND Child. Which is really weird. It was working just fine when it was all in the parent. So I’m just wondering if there’s a solution to my problem.

  • Hi there,

    I checked your site and it appears you’re in the wrong forum. Your site is using the open source WordPress.org software and you need to seek help at these forums:

    https://wordpress.org/support/forums/

    These forums are for WordPress.com hosted sites only. Since we do not have access to self-hosted WordPress.org sites, we are unable to provide any direct assistance to your issue. I would reach out to your site host for help.

    If you want to know more about the differences between WordPress.com and WordPress.org you can read this document:

    WordPress.com vs. WordPress.org

    Thanks!

  • The topic ‘Weird functions.php Issue’ is closed to new replies.