Child Theme problem

Home Forums Spacious Free Child Theme problem

This topic contains 21 replies, has 7 voices, and was last updated by  Sanjip Shah 4 years, 6 months ago.

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #7804

    David
    Participant

    Weird, I don’t remember this line being in the code I quoted above earlier today:

    /*
    For older themes, and themes that do not use wp_enqueue_style() to enqueue their stylesheet, use the following line where twentyfourteen is the name of the directory where the theme resides:
    
    Make sure you uncomment out this import line below if you want to include the parent CSS and the wp_enqueue_style() is not working. If you do not then you will not have any styling in your child theme from the parent theme.
    */

    The resource from the Codex on Child Theme mentions to uncomment or remove the comments (/* and */) surrounding the @import line. Make sure to do that and change the theme name to spacious.

    Anyways, I was able to get my child theme going. Good luck guys!

    #11317

    paynestudios
    Participant

    Minimal Child theme is still not working for me. Specifically, I created and activated a child theme spacious-child containing only one file, style.css:
    /*
    Theme Name: Spacious Child
    Theme URI:
    Description: Spacious Child Theme
    Author:
    Author URI:
    Template: spacious
    Version: 1.0.0
    Tags:
    Text Domain: spacious-child
    */

    @import url(“../spacious/style.css”);
    <snip>

    The header image that we specified does not display.

    In Firefox menu > Tools > Web Developer > Inspector, here is the structure when the child theme is activated:
    <body class=”home page page-id-2 page-template-default logged-in admin-bar left-sidebar customize-support”>
    <div id=”page” class=”hfeed site”>
    <header id=”masthead” class=”site-header clearfix”>
    <div id=”header-text-nav-container”>
    <div class=”inner-wrap”>
    <div id=”header-text-nav-wrap” class=”clearfix”>
    <div id=”header-left-section”>…</div>

    When I revert to the parent theme “spacious” and reload the exact same page, the image is placed here:
    <body class=”home page page-id-2 page-template-default logged-in admin-bar custom-background left-sidebar blog-medium customize-support”>
    <div id=”page” class=”hfeed site”>
    <header id=”masthead” class=”site-header clearfix”>
    my-site-name</img>
    <div id=”header-text-nav-container”>
    <div class=”inner-wrap”>
    <div id=”header-text-nav-wrap” class=”clearfix”>
    <div id=”header-left-section”>…</div>

    So
    1. In the <body> tag, the parent theme includes the attributes “custom-background” and “blog-medium”, but with the child theme does not.
    2. In the <header> tag, the parent theme includes the element with the custom header, but the child theme does not.

    In the Firefox > Tools > Web Developer > Style Editor, under both parent and child themes the same .css files appear to be fetched. The Console does not show any errors fetching CSS files.

    #11373

    Sanjip Shah
    Moderator

    Hi Rahul,

    You can download child theme for all our themes from here https://themegrill.com/tutorial-on-creating-wordpress-child-theme/

    #11395

    paynestudios
    Participant

    I downloaded your theme from
    https://themegrill.com/wp-content/uploads/2014/08/spacious-child.zip
    , unzipped it, uploaded the files to my WordPress site under wp-content/themes/spacious-child/, and activated it.
    Same problems:

    1. The custom header image that we specified does not display. The img tag is simply not in the generated HTML.
    2. In the Theme Customization, in the “left sidebar” widget location, we specified two widgets: Text (HTML for an image) and Search. Instead, we get all the default widgets, on the right not the left: Recent Posts, Recent Comments, Archives, Categories, Meta
    3. In the Theme Customization, in the “Navigation” section, we specified the Primary Menu in both the Primary Menu and Footer Menu. The menu appears only at top, not in the footer
    4. In that top menu:
      1. The containing <div> has a class of “menu” instead of “menu-primary-menu-container”
      2. The menu items are wrong: it displays About, Contact, Home, Blog, Media, Programs and Resources, but our menu was defined to have Home, About, Programs, Blog, Resources and Contact
      3. The individual menu items have class values like “page_item page-item-25” rather than “menu-item menu-item-type-post_type menu-item-object-page menu-item-27” (note that the item numbers differ even for the same linked page “About”)
    5. There is a missing block of styling. (This may be intentional; I’m just trying to be complete.) In the parent theme, in the <head> right after these:
      • link rel=’next’ …
      • meta name=”generator” content=”WordPress 4.0″
      • link rel=’canonical’ …
      • link rel=’shortlink’ …

      there is a block of in-line <style> about 40 lines long. With the child theme activated, this styling does not appear.

    6. The <body> tag is missing three “class” attributes: custom-background left-sidebar blog-medium.
    #11587

    Sanjip Shah
    Moderator

    Hi Paynestudios,

    Yes, if you install the parent theme adjust the settings in Appearance->Theme Options, Menus, sidebar widgets and then use a child version you will need to readjust the settings, select the custom menu again and redrag the widgets as they may have been moved to the inactive widget section. So, it is better to install the parent theme then use the child and then adjust the settings in the child theme.

    However, that being said we are working on how to make child theme take all the settings of the parent theme directly without having to readjust the settings. Either we will this compatibility in parent theme, or we will be providing some code that you add to child theme that will take the settings of the parent theme. We are looking at this once we sort this out, we will be adding this info in our child theme article here https://themegrill.com/tutorial-on-creating-wordpress-child-theme/. Thanks for pointing this out.

    #12501

    paynestudios
    Participant

    That worked, thanks!
    Just FYI, I think it may be fairly common, for someone using your theme for the first time, to decide to create a child theme after customizing. My workflow was:
    1. Search for a theme that looks good and works well (functionality)
    2. Select a theme and customize per client’s wishes (header image, widgets)
    3. Encounter some aspect that we want to change but cannot change via customization
    4. Create child theme and make changes there

    #12632

    Sanjip Shah
    Moderator

    Hi,

    Thanks for your feedback. We really appreciate this.

Viewing 7 posts - 16 through 22 (of 22 total)

You must be logged in to reply to this topic.