WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Child Theme Issues (11 posts)

  1. Antare
    Member
    Posted 4 months ago #

    March 27, 2014 - After reading many post regarding child-themes, apparently I am not alone with this issue.
    The instructions are easy enough. Create a folder for the child theme and insert a blank style.css text file. Open the style.css file in the parent theme and copy from */ to /*. Change the file name to child, add the template line, & the @import under the /*. Easy. And WordPress tells me I need to add a template. There is no child theme to activate.
    The first theme I tried WP said the theme was not installed (it is installed). I am now on my second theme. When I look for the name of the template to put on that line I use the end of the parent's theme url for the template name. Should I be doing something different? What template is WP referring too? Parent or Child? If I need a template file in the child theme, what template do I take from the Parent?
    Thanks

  2. Hestati
    Member
    Posted 4 months ago #

    In the style.css in the child theme's directory use the parent theme's directory name as template.

    So for example if your parent's folder name is responsive your template name in the child's CSS should be named responsive.

    I never use the parent's style.css but got one I use over and over I just fill in the appropriate information. Unfortunately I'm using my iPhone at the moment so I can't link my style sheet.

    Cheers,

    Karim

  3. What steps have you tried? Can you provide a link to your site with the child theme?

  4. Antare
    Member
    Posted 4 months ago #

    I have it under-construction and not visible to the public or search engines.
    I just tried a third theme and this theme had no issues. I use the same formula every-time. Although this theme is not the theme I originally wanted. I'll have to do more coding with this theme.
    I am thinking that it has to do with the name on the 'Template' line. When I look at the ending of the parent theme URL for the theme Striker it says striker-theme. The Striker theme is my first choice. I could not get this theme to work.
    Striker is based on another theme so I believe you call Striker a starter theme. Is this the problem? (PS: the second theme I tried is also classified as a starter theme).
    Are themes built using the base of another theme the problem?
    Thanks

  5. mlddev
    Member
    Posted 4 months ago #

    Hi Antare,

    You can create a child of the Striker theme. Create your child theme folder of striker-child. Create a style.css file and place only the following code in the file.

    /*
    Theme Name: Striker Child
    Template: striker
    Theme URI: http://www.templateexpress.com/striker-theme/
    Author: Ossie Heffell
    Author URI: http://www.templateexpress.com/
    Description: Striker is a fully responsive and highly customizable WordPress Theme. Add your own logo, header, background, featured areas, social links, pick from 4 different color layouts and much more.
    Version: 1.9
    License: GNU General Public License v2.0
    License URI: ​http://www.gnu.org/licenses/gpl-2.0.html
    Tags: light, white, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, featured-images, flexible-header, microformats, post-formats, rtl-language-support, threaded-comments, translation-ready, theme-options, full-width-template, black
    
    This theme, like WordPress, is licensed under the GPL.
    
    Resetting and rebuilding styles have been helped along thanks to the fine work of
    Eric Meyer http://meyerweb.com/eric/tools/css/reset/index.html
    along with Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normalize.css/
    and Blueprint http://www.blueprintcss.org/
    */
    
    /*
    Striker WordPress Theme, Copyright 2013 Ossie Heffell
    Striker Theme is distributed under the terms of the GNU GPL
    */
    
    /*
    Striker Theme based on Underscores (_s) Theme
    _s ("Underscores") WordPress Theme, Copyright 2012 Automattic, Inc.
    _s ("Underscores") WordPress Theme is distributed under the terms of the GNU GPL
    */
    
    @import url( '../striker/style.css' );

    You should already have Striker uploaded to WP.
    Upload and activate the striker-child folder containing the style.css file.

    Let me know how it goes.

  6. mlddev
    Member
    Posted 4 months ago #

    Oh and one other thing. When I downloaded Striker and extracted it. The folder name for the theme was just "striker", NOT "striker-theme". You might want to rename the folder to striker or start over with a fresh install of the theme.

  7. Antare
    Member
    Posted 4 months ago #

    @mlddev - Yes this worked great.
    So, what I take from this is that if the theme is a starter theme grab all the paragraph notes on the top of the style.css file. (/* through */) - Yes? Did I get it?

    Of course, I do understand things can change due to the discretion of the developer. LOL!

    Thank You sooo much - This information ought to help others.
    March 27, 2014

  8. mlddev
    Member
    Posted 4 months ago #

    Not exactly. I just left all the original comments in for sake of reference / credit to theme developer.

    All you really needed in the styles.css was :

    /*
    Theme Name: Striker Child
    Template: striker
    */

    And you need to have the parent them folder correct. The theme folder name is what you should have for Template:
    You can call the theme (Theme Name) whatever you want.

  9. Antare
    Member
    Posted 4 months ago #

    @mlddev

    I had to go see what was different from my first attempt, ~ 6 days ago, (when I had the original striker style.css file) & your perfect code.
    The only difference that I can tell is the very last and most important line, which begins with the @import

    I have no space after the ( before the " and no space before the )
    Are these spaces critical?

  10. stephencottontail
    Member
    Posted 4 months ago #

    No, those spaces don't matter. Could you post your child theme's style.css somewhere like pastebin and link it here? Sometimes it helps to have another set of eyes looking at it.

  11. Antare
    Member
    Posted 4 months ago #

    @stephencottontail
    It is fixed - there is no need to resume

    @mlddev resolved the issue

Reply

You must log in to post.

About this Topic