Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #237003

    Hey,

    We’ve made some modification to our enfold theme, but many of them were done inside the enfold theme and not in our child theme.
    I’d like to redo all those changes in a more elegant way, so we could easily upgrade the theme version without loosing all our modifications.
    In many cases it is quite easy to add a hook to a filter or an action, but there are cases when it is not that obvious.
    For example- we’ve changed the default parameter values in the avia_post_nav function in functions-enfold.php (instead of $same_category=false we use $same_category=true).

    I see only two options, which none of them is really satisfying, to change the default without touching the theme itself:
    1. Make a copy of this entire function into the child theme functions php file, and just change the default parameter value. This means that if tomorrow this function changes in enfold, this change would not apply for us.
    2. Make a copy of the footer.php file (which uses this function) and then pass the variable value – avia_post_nav(true). This means that if the footer.php file changes in the next enfold version, it would also not apply for us.

    Which of the above is preferred? (I personally think that cloning the footer is better). Is there any other more elegant way?

    Thanks,
    Lior

    #237370

    Hey modelity!

    Cloning files on the child theme directory is a common practice if you want to preserve the modifications. Unfortunately, the theme doesn’t have filters for all the options that you want to change so you might need to copy the whole function or create the same file on the child theme directory.

    Cheers!
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.