• ronspinabella

    (@ronspinabella)


    Hi Everybody. I just bought this theme that I’m customizing for the company I work for and am encountering problems with the child stylesheet loading properly.
    It loads on some pages and not others. I went to the developers site for help and their answer was “Put your css in our custom css section”. I don’t want to do that, its sloppy code plus, i need to override some of their parent styles.
    Here is the functions.php file for the parent theme and the child theme.
    Can you tell me if there is something in here that is causing the child stylesheet to only load on some of the pages?
    Parent functions.php:
    <?php
    define(‘G5PLUS_HOME_URL’, trailingslashit(home_url(‘/’)));
    define(‘G5PLUS_THEME_DIR’, trailingslashit(get_template_directory()));
    define(‘G5PLUS_THEME_URL’, trailingslashit(get_template_directory_uri()));

    /**
    * Include Theme Library
    * *******************************************************
    */
    if (!function_exists(‘g5plus_include_library’)) {
    function g5plus_include_library()
    {
    require_once(G5PLUS_THEME_DIR . ‘inc/register-require-plugin.php’);
    require_once(G5PLUS_THEME_DIR . ‘inc/frontend-enqueue.php’);
    require_once(G5PLUS_THEME_DIR . ‘inc/admin-enqueue.php’);
    require_once(G5PLUS_THEME_DIR . ‘inc/theme-setup.php’);
    require_once(G5PLUS_THEME_DIR . ‘inc/theme-functions.php’);
    require_once(G5PLUS_THEME_DIR . ‘inc/theme-action.php’);
    require_once(G5PLUS_THEME_DIR . ‘inc/theme-filter.php’);
    require_once(G5PLUS_THEME_DIR . ‘inc/sidebar.php’);
    require_once(G5PLUS_THEME_DIR . ‘inc/ajax.php’ );
    require_once(G5PLUS_THEME_DIR . ‘core/post-format-ui/post-format-ui.php’);
    require_once(G5PLUS_THEME_DIR . ‘core/resize.php’);
    require_once(G5PLUS_THEME_DIR . ‘core/woocommerce.php’);
    require_once(G5PLUS_THEME_DIR . ‘core/widget-custom-class.php’);
    require_once(G5PLUS_THEME_DIR . ‘templates/single/post-like.php’);
    }
    g5plus_include_library();
    }

    Child Functions.php:

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘g5plus_child_theme_enqueue_styles’, 1000 );
    function g5plus_child_theme_enqueue_styles() {
    wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array( ‘g5plus_framework_style’ ) );
    }

    add_action( ‘after_setup_theme’, ‘g5plus_child_theme_setup’);
    function g5plus_child_theme_setup(){
    $language_path = get_stylesheet_directory() .’/languages’;
    if(is_dir($language_path)){
    load_child_theme_textdomain(‘g5plus-moveco’, $language_path );
    }
    }
    // if you want to add some custom function

    Thank you everyone I really appreciate the help

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Child Stylesheet only loading on some pages’ is closed to new replies.