issue with child theme on mobile

  • Author
    Posts
  • #76599

    Hello,

    i’m working on a client website based on NIRVANA.
    I created a child theme with “Child Theme Configurator” plugin, in order to keep all the previous settings.

    But, after activating Child Theme, everything is working well, except that my posts sidebar mess with mobile view that compress all the content on 5% of the screeen.

    I already see your advice to add

    // enqueue parent theme styling
    function child_parent_styling(){
    	wp_enqueue_style( 'nirvana-style', get_template_directory_uri() . '/style.css', array(), _CRYOUT_THEME_VERSION );  // restore parent stylesheet
    	wp_enqueue_style( 'nirvana-child', get_stylesheet_directory_uri() . '/style.css', array( 'nirvana-style' ), '0.7' ); // enqueue child 
    }
    add_action('wp_enqueue_scripts','child_parent_styling');

    in functions.php

    But this doesn’t change anything.

    Here is what my functions.php looks like

    // enqueue parent theme styling
    function child_parent_styling(){
    	wp_enqueue_style( 'nirvana-style', get_template_directory_uri() . '/style.css', array(), _CRYOUT_THEME_VERSION );  // restore parent stylesheet
    	wp_enqueue_style( 'nirvana-child', get_stylesheet_directory_uri() . '/style.css', array( 'nirvana-style' ), '0.7' ); // enqueue child 
    }
    add_action('wp_enqueue_scripts','child_parent_styling');
    
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED - Do not modify or remove comment markers above or below:
    
    if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
        function chld_thm_cfg_locale_css( $uri ){
            if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
                $uri = get_template_directory_uri() . '/rtl.css';
            return $uri;
        }
    endif;
    add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
    
    if ( !function_exists( 'chld_thm_cfg_add_parent_dep' ) ):
    function chld_thm_cfg_add_parent_dep() {
        global $wp_styles;
        array_unshift( $wp_styles->registered[ 'nirvana-style' ]->deps, 'nirvana-mobile' );
    }
    endif;
    add_action( 'wp_head', 'chld_thm_cfg_add_parent_dep', 2 );
    
    // END ENQUEUE PARENT ACTION

    Thanks in advance for your help.

    #76753
    Zed
    Cryout Creations mastermind

    Use only the suggested code in the child theme to ensure the theme’s styles and loaded in the correct order.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘issue with child theme on mobile’ is closed to new replies.