• Resolved sathishkumarcw

    (@sathishkumarcw)


    Hi,

    I created the child theme by referring this link

    https://demo.webhuntinfotech.com/blog/2016/01/11/how-to-create-a-child-theme/

    And my functions.php files contains following lines

    <?php
    /** Theme Name: Kyma Child
     *  Custom Functions and Codes
     **/
    
    // Loads Parent Theme CSS Styles In Child Theme
    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() . '/custom.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 );
        } );
    }

    style.css files contains following lines

    /*
       Theme Name: Kyma Child
       Description: This is a custom child theme of kyma theme.
       Author: WP
       Template: Kyma
       Version: 0.1
       */

    but when i view the theme in mobile menu doesn’t appears

    guide me how can i fix this

    testing in localhost ( using Xampp )

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author WebHunt Infotech

    (@webhuntinfotech)

    Hi,

    Put below line of code in “functions.php” file of your “Child-Theme” directory.

    <?php
    /** Theme Name: Kyma Child
     *  Custom Functions and Codes
     **/
    
    // Loads Parent Theme CSS Styles In Child Theme
    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('responsive-kyma', get_template_directory_uri() . '/css/responsive.css');
    	 wp_enqueue_style( 'child-style',get_stylesheet_directory_uri() . '/custom.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 );
        } );
    }

    Save the changes.

    Hope it will help you. if not please provide a site URL.

    Thank You

    Thread Starter sathishkumarcw

    (@sathishkumarcw)

    Hi,

    Above code works fine and now menu works on mobile display

    Thank You !!!

    Theme Author WebHunt Infotech

    (@webhuntinfotech)

    Most Welcome.

    Thank You

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Menu not showing in child theme’ is closed to new replies.