1

I'm trying to add some new functionalities to a theme and I'm using Child Theme as should be. So the theme is called u-design and I created a folder called u-design-child. Inside the folder I've created two files: style.css and functions.php. This is the content for each one so far:

// style.css
/*
Theme Name: U-Design Child
Theme URI: http://localhost
Description: Child theme for U-Design.
Author: Reynier
Author URI: http://localhost
Version: 1
License: Located in 'licensing' folder
License URI: Located in 'licensing' folder
*/

// functions.php 
<?php
// Add Shortcode for Random Phrases
function random_phrase()
{
    $args = array(
        'post_type'      => 'frase',
        'posts_per_page' => 1,
        'orderby'        => 'rand'
    );

    $query = new WP_Query($args);

    // Build output string
    $quo = '';
    $quo .= $query->post->post_title;
    $quo .= ' said "';
    $quo .= $query->post->post_content;
    $quo .= '"';

    return $quo;
}

add_shortcode('phrase', 'random_phrase');

But when I go to Appearance > Themes and try to enable the child theme I see this:

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

What I've missed here? Any advice?

1 Answer 1

6

You are missing the Template: definition in your stylesheet header. This is the folder name of the parent theme

For instance, a child theme of the bundled theme will have the Template: defined as

Template: twentyfifteen 
1
  • Thx, that fixes my problem
    – ReynierPM
    Jun 28, 2015 at 19:03

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.