[Resolved] Which is the ideal place to insert functions?

Home Forums Support [Resolved] Which is the ideal place to insert functions?

Home Forums Support Which is the ideal place to insert functions?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #645382
    Zad

    What is the ideal place to run functions for performance, error handling, saving configurations etc,

    I know some of the options we have are:

    – function.php file in a child theme ( I use this)
    – using the plugin, CodeSnippets (also use this)
    – using hooks on GeneratePress (also use this)

    Which is the better one to use? I’m considering moving all my functions from my functions.php file onto CodeSnippets.

    #645412
    Leo
    Staff
    Customer Support

    Hi there,

    I would say all in function.php of your child theme if you are already using a child theme.

    Let me know if this helps πŸ™‚

    #645482
    Zad

    Thanks!

    #645487
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

    #646008
    Brett

    Just to piggyback on this topic, since it was so recent. (Thanks!)

    I just installed the child theme (https://docs.generatepress.com/article/using-child-theme/), activated it, and when I go to the Appearance/Themes/Editor I’m still getting the “Heads Up” warning. I see the child CSS Style in the background. Should I need to add a funtions.php to the child theme folder for adding my functions? If so, what is required as a skeleton?
    Thank you!

    #646028
    Leo
    Staff
    Customer Support

    Not quite sure if I understand?

    If you need to add functions then yes you will need to create functions.php.

    #647386
    Brett

    Thanks!

    #647444
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

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