Home › SUPPORT FORUMS › JOOP WordPress theme › Modify a PHP file in JOOP Child Theme

This topic contains 3 replies, has 2 voices, and was last updated by  kevin(Staff) 1 day, 19 hours ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #63407

    Hi,
    I was wondering if it’s possible to modify a php file inside ‘tdframework’ or ‘woo commerce’ directory on my JOOP child theme. I was trying this and it didn’t worked out. Is there a way to get this working, or do I have to modify the original file?

    Thanks for your support

    #63409

    Hi Calaveras,

    The way child themes work is not really a theme-related thing, but here is how I believe these things work:

    there are two different things that can be done with PHP files.

    -First there’s the functions.php file (which is a special case).
    When you make a functions.php file in your child theme, any functions you will create there will be loaded in addition to the parent theme’s functions. More specifically (if I’m not mistaken) they are loaded before your parent theme’s functions.
    For this particular file, you’ll want to start with an empty file named functions.php

    -Secondly, there’s the theme php-files
    Other php files from the parent theme, such as archive.php, header.php etc will be completely overridden when a file with the same name exists in the child theme. That means that all the parent’s php in that file will be disregarded and replaced by the child’s php.
    For these other files, if you are planning to make changes to the php, not completely rewrite a file. You’ll want to start by loading a copy of the file from the parent’s theme into your child theme and the altering that

    To make this complete, child theme css files are loaded after the parent theme’s css files have been loaded, so that they will overwrite any css from the parent’s files that may affect the same elements.

    I hope this helps,

    Kind regards,
    Kevin

    #63422

    The problem is that I tried that, by making a copy of this file and pasting it on my child theme. Didn’t worked out. The file that I’m modifying specifically is core-sociables.php on tdframework/core

    Hope if there’s a way to get this, if not, I will modify the original file.

    Regards

    #63429

    Hi Calaveras,

    Just to be sure..
    Have you also replicated the directory structure in your child theme by placing it in tdframework\core\ in your child theme as well?

    It probably won’t recognize it to be the same file if you don’t do that.

    Kind regards,
    Kevin

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

You must be logged in to reply to this topic.