0

I create a new style.css and use it in child theme. And I create a new folder in wp-content and name it as themename-child and upload the style.css that I created. Now, I go to wp dashboard -> Appearance -> Themes and I look the child theme that I create. And I found this error:

Broken Themes

The following themes are installed but incomplete. Themes must have a stylesheet and a     template.

Name    Description
Accesspress Lite    The parent theme is missing. Please install the "AccesspressLite" parent theme.

Here's the css child theme format:

/*
Theme Name:   Accesspress Lite
Theme URI:    http://access-keys.com/accesspresslite/
Description:  Accesspress Lite Child Theme
Author:       Yang
Author URI:   http://www.example.com
Template:     accesspress-lite
Version:      2
Tags:         blue, white, light, custom-menu, one-column, two-columns, three-columns,   left-sidebar, right-sidebar, fixed-layout, fluid-layout, custom-background, featured-image-header, sticky-post, theme-options, threaded-comments, featured-images, full-width-template, custom-header, flexible-header, responsive-layout
Text Domain:  accesspress-lite-child
*/

@import url("../accesspress-lite/style.css");

3 Answers 3

1

All the information you need can be found here: https://codex.wordpress.org/Child_Themes

The important parts to get it up and running would be to:

Make sure the parent theme exists (the complete accesspress-lite theme in your case)

Create a unique folder name for your child theme.

Create a style.css file in your child theme folder.

/*
Theme Name:   Your Child Theme Name
Theme URI:    http://access-keys.com/accesspresslite/
Description:  Accesspress Lite Child Theme
Author:       Your Name
Author URI:   http://www.your-child-theme.com
Template:     accesspress-lite
Version:      1.0
Tags:         blue, white, light, custom-menu, one-column, two-columns, three-columns,   left-sidebar, right-sidebar, fixed-layout, fluid-layout, custom-background, featured-image-header, sticky-post, theme-options, threaded-comments, featured-images, full-width-template, custom-header, flexible-header, responsive-layout
Text Domain:  accesspress-lite-child
*/

Make sure the Template line matches the parent them folder.

Create a functions.php file within the child theme folder. In that file, import your parent theme styles. Doing this instead of an @import in your stylesheet makes sure that the dependencies are met.

function child_theme_enqueue_styles() {
    wp_enqueue_style( 'parent-styles', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-styles',
        get_stylesheet_directory_uri() . '/style.css',
        array( 'parent-styles' )
    );
}
add_action( 'wp_enqueue_scripts', 'child_theme_enqueue_styles' );

Note that as a child theme, any time you use get_template_directory_uri() you're grabbing the parent theme directory. Using get_stylesheet_directory_uri() will give you the child theme directory.

1

This should help you out and clear up a few things. This was done for another theme, you should just change the parent theme paths accordingly

For the sake of creating a child theme and understanding what is what, I will help you here. This is how the child theme stylesheet header should look like (or any parent theme for that matter)

/*
Theme Name:   Accesspress Lite Child
Theme URI:    http://access-keys.com/accesspresslite/
Description:  Accesspress Lite Child Theme
Author:       Yang
Author URI:   http://example.com
Template:     accesspress-lite
Version:      2
Tags:         blue, white, light, custom-menu, one-column, two-columns, three-columns,   left-sidebar, right-sidebar,
fixed-layout, fluid-layout, custom-background, featured-image-header,
sticky-post, theme-options, threaded-comments, featured-images,
full-width-template, custom-header, flexible-header, responsive-layout
Text Domain:  accesspress-lite-child
*/
  • Theme Name => The name of your child theme, can be anything to your desire
  • Theme URI => The path to the theme where it can be downloaded
  • Description => Short description what your theme is all about.
  • Author => The person who coded the child theme
  • Author URI => URL to the website of the author who coded the theme
  • Template => The folder in which the parent themes' style.css resides
  • Version => self explanatory, the version to the theme
  • Tags => Related tags for your theme for tag search results, used on wordpress.org
  • Text Domain => The text domain (unique identifier) that will be used by translators for translatable strings in the theme
  • @import url(); => The actual path to the style.css of the parent theme

What is needed in a child theme:

Only the following are needed for a personal child theme that will not be distributed

  • Theme Name
  • Template
  • Text Domain (only if you going to localize your theme using po and mo files)
  • @import url()

EDIT

@import should not be used to call the parent stylesheet, or any stylesheet for that matter. The correct way is to enqueue and register a stylesheet with wp_enqueue_style() and wp_register_style() hooked to wp_enqueue_scripts hook. This whoole method is described in my answer here

0
-3

add in themename-child style.css:

/*
Theme Name: Your Theme
Version: 1.0
Author: Your Author
*/

uploat to host

6
  • I already put that but still I have an error
    – Yang
    Jun 20, 2014 at 4:04
  • remove all code in style.css and add my code and view again
    – Hoang An
    Jun 20, 2014 at 4:06
  • you add folder to wp-content or wp-content/theme/ ????
    – Hoang An
    Jun 20, 2014 at 4:07
  • Still I have same error
    – Yang
    Jun 20, 2014 at 4:09
  • wp-content/theme
    – Yang
    Jun 20, 2014 at 4:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.