L
L
ligisayan2016-02-22 16:22:43
WordPress
ligisayan, 2016-02-22 16:22:43

Why is Parallax One wordpress child theme not being created?

Hello! I want to create a child theme wordpress theme Parallax One , for which I create a folder in Parallax-one-child themes, where I placed the style.css file:

/*
   Theme Name: Parallax One Child
   Theme URI: http://likemedia.by/
   Description: This is a custom child theme I have created.
   Author: Someone
   URI: http://someone.by/
   Template: Parallax One
   Version: 0.1 
   */

and functions.php:
add_action( 'wp_enqueue_scripts', 'child_enqueue_styles',99);
function child_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 ));
}
if ( get_stylesheet() !== get_template() ) {
    add_filter( 'pre_update_option_theme_mods_' . get_stylesheet(), function ( $value, $old_value ) {
         update_option( 'theme_mods_' . get_template(), $value );
         return $old_value; // prevent update to child theme mods
    }, 10, 2 );
    add_filter( 'pre_option_theme_mods_' . get_stylesheet(), function ( $default ) {
        return get_option( 'theme_mods_' . get_template(), $default );
    } );
}

but it doesn't appear in the admin theme section - why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor, 2016-02-25
@DarkSir

Actually, if it is not possible to upgrade to a new version, try changing the parallax_get_file function in the function.php file

if ( file_exists( $file_path ) ){
  return esc_url(get_stylesheet_directory_uri() . $file); 
} else {
  return esc_url(get_template_directory_uri() . $file);
}

fixed child theme support

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question