• Resolved ozsecure

    (@ozsecure)


    Hi there,

    I’m trying to create a child theme for MyWiki, and i’ve modified my style.css so it has my colors etc.

    My functions.php looks like this:

    <?php
    //add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    //function theme_enqueue_styles() {
    //    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    //}
    
    wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '3.0.1', 'all' );
    wp_enqueue_style('style', get_stylesheet_uri());
    wp_enqueue_script( 'bootstrap',  get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.0.1');
    wp_enqueue_script( 'ajaxsearch',  get_template_directory_uri() . '/js/ajaxsearch.js', array(), '1.0.0');
    wp_enqueue_script( 'general',  get_template_directory_uri() . '/js/general.js');
    wp_localize_script( 'general', 'my_ajax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );

    If I don’t include these “wp_enqueue_style” the layout of the site is really broken.

    However my theme’s style sheet seems to load the mywiki-child/style.css stylesheet in wp-admin.

    Any suggestions on how to create a correctly configured child theme? In other themes I’ve used i just add this and it works…

    `<?php
    function theme_enqueue_styles() {

    $parent_style = ‘parent-style’;

    wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘child-style’,
    get_stylesheet_directory_uri() . ‘/style.css’,
    array( $parent_style )
    );
    }
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    ?>
    `

Viewing 3 replies - 1 through 3 (of 3 total)
  • I have the same issue.

    Theme Author FasterThemes

    (@fasterthemes)

    Theme does support Child themes.
    Not sure where the problem is. You can check the code again.
    If you find something to change in the main theme (parent) files, will make changes.

    I recently downloaded this theme and also ran into problems setting up a child theme.

    I spent a lot of time trying to puzzle things out, and then I deleted my child theme and downloaded a free plugin, Child Theme Configurator.. and used that to create the theme – and everything was resolved. This plugin has a step where it analyzes the parent theme before setting up the child functions.php file…. and apparently it automatically figured out what was needed.

    So I’d recommend using this plugin to start.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Child Themes’ is closed to new replies.