Support » Plugin: Childify Me » How to set up Functions.php

  • I’ve just activated this plugin and created a Child theme.

    Well, actually the plugin did what everybody can do for a minute.
    The most important functions.php file is not set up. Without this, the customization of files can’t be done.

    So the child theme is not working. How to customize files now?

    What’s the meaning of plugin then?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Rocco Aliberti

    (@d4z_c0nf)

    Hi there,
    thanks.

    Well, actually the plugin did what everybody can do for a minute.

    Yeah that’s the purpose of the plugin:
    creates a theme folder with a reference to the parent theme in the child-theme style.css.

    The only file required for a child-theme is a style.css where it’s declared that the theme is a child of a parent theme:
    https://developer.wordpress.org/themes/advanced-topics/child-themes/#2-create-a-stylesheet-style-css
    (see which are the required information)
    That file and those information make a theme a child-theme.

    The functions.php is not mandatory at all, as, most of the time (actually it’s a common practice), the parent theme will load the child theme style.css trough, something like this:
    wp_enqueue_style( 'twentynineteen-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) );
    (in fact get_stylesheet_uri() will return the child-theme folder if the active theme is a child-theme)

    Unfortunately there’s no unique way to create a child-theme that will perfectly work with all the parent themes.

    Some of them need the child-theme to enqueue its own style.css by itself, some other will take care about it, some other have the main CSS rules not placed in their style.css, and so on. For some of them the suggested methods to enqueue the child-theme stylesheet here:
    https://developer.wordpress.org/themes/advanced-topics/child-themes/#3-enqueue-stylesheet
    works fine, for some other it doesn’t, and so on.

    I don’t want to overcomplicate the logic of this plugin to take in account all the possible edge cases. This plugin is simple and works for simple cases 😀

    I encourage you to try other plugins that will probably better suit your needs. 😀
    https://wordpress.org/plugins/search/child+theme/

    Hope this helps.

    p.s.
    Here you can also find the reason why this plug-in creates the child-theme the way it does:
    https://wordpress.org/support/topic/needs-update-12/

    Well, it might be like that but…

    One of the must purposes of the child theme is changing the footer text and link (Powered by etc.).
    This is a must for every child theme.
    Giving this way, the child of this plugin doesn’t allow change of the footer.php

    style.css only change colors, shape sizes and fonts.

    Plugin Author Rocco Aliberti

    (@d4z_c0nf)

    I’m not sure I get what you mean:
    To change a “php” part of the parent theme you have to:
    1) copy a parent theme template file into the child-theme folder
    or
    2) use some hooks, provided by the parent theme, in the child-theme functions.php.

    Now, this plugin creates the child-theme functions.php where you can add your custom code for the point 2).

    This or any other plugin to create child-theme, DOESN’T HAVE to copy ALL the parent theme template files into the child theme folder, it would make no sense, it would anchor your child-theme to the parent theme version at the moment you created a child-theme.
    Only you can know which parent template files you need to override in your child-theme, hence only you can do it. If you’re suggesting that this plugin should allow you to choose which parent theme file should be copied in the child-theme folder ok, I see what you mean, but no it doesn’t do this.

    This plug-in only creates a basic child-theme, configurations and customization are up to you 😀

    Thanks for taking the time to share your opinion on this plugin!

    Best regards.

    Rocco

    Nobody wants point 1). No need of this long statement which is referred only to needless point 1).

    Point 2) is what we are talking about.
    The most users of plugins can’t add custom code to functions.php because they don’t understand the codes otherwise they will create the plugin they want.
    The plugins are to support the main developers of web-sites in creating them.
    They need code writers to assist them in this work.

    Anyway, I understand what is the situation here.

    Cheers!

    Plugin Author Rocco Aliberti

    (@d4z_c0nf)

    Hi,
    sorry for this late reply, I’ve been busy with my job.
    I see what you mean, but
    1) You’re wrong, I won’t say that’s the main purpose of a child-theme, but for sure that’s a very common use of it. See:
    https://developer.wordpress.org/themes/advanced-topics/child-themes/#adding-template-files
    WordPress has specific code to allow this, and themes are encouraged, when not obliged, to allow the template files overriding in the child-themes, see: https://developer.wordpress.org/reference/functions/get_template_part/

    So that’s absolutely not a needless point.

    2) That’s your opinion of course.

    The plugins are to support the main developers of web-sites in creating them.

    To me plugins are to add functionality/features that are not provided by the core.
    There are plugins of all types and for all types of users, not just for developers, and this is, most likely, one of the major reasons behind the WordPress success.

    And that’s my opinion of course :).

    Best regards.

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