Site logo

[Resolved] Questions about Child Theme

Home Forums Support [Resolved] Questions about Child Theme

Home Forums Support Questions about Child Theme

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #2495473
    Anonymous

    Hello,

    Just got a few questions about Child Theme:

    1. What is the best way to create a Child Theme for my website with GeneratePress website?

    2. On functions.php I add all php snippets from php snippets plugin? So, I can stop using this plugin, correct?

    3. On styles.css do I add all extra CSS code from the Additional CSS field in the customizer? Or what CSS should be added there?

    4. Are child themes secure or they are a hacking risk for website since most WordPress hacks come from themes and plugins?

    Thanks,

    Sara

    #2495635
    Ying
    Staff
    Customer Support

    Hi Sara,

    1. check this article: https://docs.generatepress.com/article/using-child-theme/

    2. Yes, if you have a child theme installed, you can move all PHP snippets from the plugin to the child theme’s functions.php file, the plugin is no longer needed.

    3. Yes, you can do so, or you can leave it in the additional CSS field, it doesn’t really matter.

    4. I don’t think so.

    #2539855
    Anonymous

    Hello Ying,

    Sorry for the late reply, I had done that but it seems I am making something wrong since I am getting “There has been a critical error on this website.”, the steps I done are the following:

    1) I downloaded generatepres child theme from link you provided

    2) I add all php functions that I had on php snippet to functions.php

    3) I add all CSS code I got on customizer “Additional CSS” to style.css

    #2540294
    Leo
    Staff
    Customer Support

    It seems problem comes from functions.php file since I delete all content from file it works fine, what I am doing wrong?

    Can you delete the functions one by one and see if you can identify the problem that way?

    Or you can remove all functions first, make sure it works, then add the function in one by one.

    #2541107
    Anonymous

    Hi Leo,

    I just tested as you say function one by one and it seems both functions give error the only part of code that seems to work is the one below:

    When I try to add the functions or the add filter code at the end gives error.

    Could this be a problem with server permissions? or what you think it could be?

    Thanks for your time,

    Sara

    #2541139
    David
    Staff
    Customer Support

    Hi there,

    before you added the child theme, were those PHP Snippets added to the site using any other method ? eg. Code Snippets plugin. If so are they still on the site ?

    #2541214
    Anonymous

    Hello David,

    You were absolutely right! The moment I deactivated PHP snippets with same code and activated child theme with functions on it worked perfectly.

    Can you just make me a favor before closing ticket and delete all code from both files from my previous post?

    Thanks a lot for your help and sorry for not considering such a simple solution!

    #2541219
    David
    Staff
    Customer Support

    You’re welcome, and code deleted 🙂

    #2542555
    Anonymous

    Perfect thank you very much 🙂

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