• I created a child theme which seemed to work until I noticed I could no longer choose the page layout templates from a drop-down list as in the parent theme.
    After deactivating and reactivating the child theme, I got an error child theme broken reverting to default twenty twelve.
    I uninstalling and re-installing the parent theme, reducing the child theme to the bare stlye.css with the @import url(“../mosaic/style.css”);
    Still no luck so I then renamed the child theme to child theme old and it now works and the templates are available.
    Happy, but intrigued as to what caused the issue and whether it might reappear, I began reading on non child-theme friendly themes and noticed my parent themes seems to qualify.
    It uses require once several times.
    It defines using get_stylesheet_directory instead of get_template_directory
    Several suggestions are given to alleviate the problems and I would like some confirmation on procedures I would like to do to prevent breakage.
    Should I add the following files to child directory to ensure my child theme continues working?
    1. theme-options.php file containing // Include Theme Options from parent theme directory
    <?php
    require_once ( get_template_directory() . '/theme-options.php' );
    ?>

    2. shortcodes.php // Include require once file for shortcodes file from parent theme
    <?php
    require_once( MOSAIC_PARENT_DIR . '/shortcodes.php' );
    ?>

    3. options-framework.php // Include Options Framework from parent theme directory
    <?php
    require_once( OPTIONS_FRAMEWORK_DIRECTORY . 'options-framework.php' );
    ?>

    4.functions.php /* point to parent template folder for page layouts not stylesheet folder */
    <?php
    define( 'MOSAIC_CHILD_DIR', get_template_directory() );
    ?>

    Thanks in advance!

Viewing 15 replies - 1 through 15 (of 18 total)
  • What’re the problems you had in the child theme? I just made one to test it and it seems to work okay in using different page templates, but maybe I’m missing something you’re experiencing.

    Thread Starter razoredger

    (@razoredger)

    Hi,
    Yes, I have had this child theme working from the start. My original working child-theme contains: style.css with only import line, loop-page.php, footer.php, header.php

    In answer to your question, the problem is that the child theme loses the drop-down template selection for pages and posts feature of the parent theme.

    This issue arose when I needed to switch page template and there were no templates selection available.

    Intrigued and needed a solution, I switched back to the parent theme. The templates selection re-appeared. I changed the template for the page in question. After which, I switched back to the child-theme but instead of completing the operation, WP announced the child-theme broken and reverted itself to Twenty-Twelve, removing the child-theme from possible actives.

    I actually got it working again by leaving the child-them folder as is and simply changing it’s name and them name to child theme old. It unexpectedly reappeared in the themes list and I was then able to activate this “new” child theme without incident.

    However, as before, no page template selection was possible.

    To resolve that issue, I have now copied all page templates to the child-theme folder.

    My objectives now:
    1. Store only customized files in the child-theme directory while retaining page template selection.
    3. Prevent future “theme broken” errors and potential theme loss.

    According to reading on non child-theme friendly issues, I believe the procedure I mentioned in my first post to accomplish that. I would like comments in this regard.

    Thanks!

    What parent theme are you using? Where did you download it from?

    Thread Starter razoredger

    (@razoredger)

    Oh and I would like to mention, that since implementing the child theme, the pages have began loading at a snail’s pace.

    I believe this slow loading issue to be related but don’t know yet how to treat it.
    Regards!

    Thread Starter razoredger

    (@razoredger)

    Parent theme is mosaic, it’s a skeleton based theme.
    I downloaded it directly to WP from the add themes admin panel in my WP installation.

    My template selection works fine when creating pages…

    Maybe you should try recreating the child theme from scratch and star with ONLY the style.css file in it?

    Have you considered posting about this in the parent theme’s dedicated forum?

    Thread Starter razoredger

    (@razoredger)

    Okay, I did actually try that also, recreating the them with only the style.css. As before it works, just no page template selection for the child-them.
    I will re-try.

    No I haven’t posted in the parent themes dedicated forum. No posts related to child theme related to that particular theme came up in search results for the topic.
    I will look into it more.

    just no page template selection for the child-theme

    Just to be sure we are talking about the same thing – when you create a new page (under Pages), you’re saying that you have no templates in the Page Attributes > Template box on the right side of the screen?

    Thread Starter razoredger

    (@razoredger)

    Okay I just activated the child theme containing only the empty style.css with the load line.
    I can see the template files options for pages.
    However the sidebar has disappeared. I have same settings as before, one column with a right sidebar.

    Changing the sidebar side doesn’t help.

    Thread Starter razoredger

    (@razoredger)

    Just to be sure we are talking about the same thing – when you create a new page (under Pages), you’re saying that you have no templates in the Page Attributes > Template box on the right side of the screen?

    Correct.

    Do you have any widgets in the sidebars? Some themes only show them if there’s something in there.

    Also possibly a plugin conflict?

    Thread Starter razoredger

    (@razoredger)

    Yes lots of widgets.

    The same child-theme with the same widgets, simply renamed child-theme old works with a sidebar intact.
    Once I copied over all the page templates to the child them folder, the template selection works.

    I do believe something in the theme is calling those page templates inside the child theme directory instead of the parent directory.
    Maybe here?

    /*———————————————————————————–*/
    /* Set Proper Parent/Child theme paths for inclusion
    /*———————————————————————————–*/
    define( ‘MOSAIC_PARENT_DIR’, get_template_directory() );
    define( ‘MOSAIC_CHILD_DIR’, get_stylesheet_directory() );

    define( ‘MOSAIC_PARENT_URL’, get_template_directory_uri() );
    define( ‘MOSAIC_CHILD_URL’, get_stylesheet_directory_uri() );

    Nope – those defines look OK. However, it might be worth looking through the parent’s files to see where they are being used.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Child Theme issues’ is closed to new replies.