New Landing How can we help? Themeforest Theme Support Dante Child Theme – am I doing it right?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Posted in: Dante
  • #64652
    tracytracy
    Member
    Post count: 29

    If I have the child theme set up correctly and am using that as my theme what files should I see in the Dante-child theme folder? Because I’ve only got 4 which include the styles.css and functions.php – and both of those are basically empty shells.

    I started building the theme in the Parent version and then switched over to the child, I had only made a few minor CSS adjustments but I did make one change to the functions.php. Which isn’t in child functions.php.

    But because the child functions.php is basically empty do I just copy in that additional bit of code? Will that even work? It doesn’t seem like it would being taken out of context. So this doesn’t seem like the logical set-up – so either I’m thinking too much or I’m doing it wrong. Should the parent/functions.php file be copied over/saved as into the child and I work on that? Or work in the blank child/functions.php just adding the additions?

    thanks

    #64803
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Yes the child theme contains basically empty files, any additional/custom css, you add to the child theme style.css file (never add to parent css because it will be overwritten when you update the theme). The parent css is already imported into the child theme css file, so make sure you don’t copy it all over into the child theme.

    As for the functions.php file, this is a little more tricky, any new functions can be added to the child theme file. However when it comes to editing functions from the parent theme, not all functions can be included in the child theme, only ones that state ‘if this function does not exist, do the function’ which looks like this:

    if (!function_exists('sf_top_bar')) {
    		function sf_top_bar() {

    It needs to have the ‘!’ or it can’t be overwritten, because if the function is called twice (parent theme and child theme) it will break your site.

    Hope this helps

    – Kyle

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register