WordPress.org

Forums

Delicacy
[resolved] Using child themes (6 posts)

  1. mjpg
    Member
    Posted 2 years ago #

    I am testing Delicacy Version: 1.2.4.

    Thanks for this theme, which looks good.

    I started using a child theme, but had some errors.

    I have fixed a couple:

    functions.php line 160 - changed to:

    include RWMB_DIR . 'metabox-def.php';

    functions.php lines 234 to 240 - changed temporarily to:

    //if ( get_stylesheet_directory() == get_template_directory() ) {
    	define('OPTIONS_FRAMEWORK_URL', get_template_directory() . '/admin/');
    	define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/admin/');
    //} else {
    	//define('OPTIONS_FRAMEWORK_URL', get_stylesheet_directory() . '/admin/');
    	//define('OPTIONS_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri() . '/admin/');
    //}

    This stops the error messages, but there are still oddities.

    My child theme only has style.css and an @import for the CSS.

    Has anyone else got this to work OK with a child theme?

    Thanks

  2. Andrew
    Nuh uh moderator
    Posted 2 years ago #

    My child theme only has style.css and an @import for the CSS.

    Sorry, can you elaborate on how this is causing you issues?

  3. mjpg
    Member
    Posted 2 years ago #

    Sorry - yes I should have stated the error:

    With no modifications to the delicacy functions.php I get this when a simple child theme is activated:

    Warning: require_once(/PATH-REMOVED/wp-content/themes/bcs/meta-box/meta-box.php) [function.require-once]: failed to open stream: No such file or directory in /PATH-REMOVED/wp-content/themes/delicacy/functions.php on line 157:

    I think the problem is here:

    // Re-define meta box path and URL
    define( 'RWMB_URL', trailingslashit( get_stylesheet_directory_uri() . '/meta-box' ) );
    define( 'RWMB_DIR', trailingslashit( get_stylesheet_directory() . '/meta-box' ) );

    And later on with the test for:

    if ( get_stylesheet_directory() == get_template_directory() ) {

    possibly should be

    if ( get_stylesheet_directory() != get_template_directory() ) {

    I think the above two sections of code are dealing wrongly with the case where there IS a child theme. Not sure though.

    Thanks

  4. alex27
    Member
    Theme Author

    Posted 2 years ago #

    For the child theme to work, you need to manually copy admin folder from Delicacy to your new child theme folder. It's a bug though, and should be fixed in the next update (that will come somwhere in january).

  5. mjpg
    Member
    Posted 2 years ago #

    Many thanks for your reply.

  6. mjpg
    Member
    Posted 2 years ago #

    I tested this and just copying the admin folder does not work as the theme also asks for files from the meta folder.

    It works without error if you copy these folders to the child theme folder:

    delicacy/admin
    delicacy/meta-box

    However the styles are not applying correctly. I cannot quite see why.

    As it is now, I think the best option is to make changes to a copy of delicacy and make a note of what they are so you can move them to a child theme after the next release.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic