Installing a Child Theme & editting the style.css

Hi,

I am trying to install the child theme and edit the style.css file. I left the functions.php file as default and the stylesheet is not loading as should be. It's taking quite a long time for the page to load, which might be because of some overriding issue. Can you help me sort it plz?


The code is here:

Functions.php File (Child Theme)

<?php
/**
 * Betheme Child Theme
 *
 * @package Betheme Child Theme
 * @author Muffin group
 * @link https://muffingroup.com
 */

/**
 * Child Theme constants
 * You can change below constants
 */

// white label

define('WHITE_LABEL', false);

/**
 * Enqueue Styles
 */

function mfnch_enqueue_styles()
{
    // enqueue the parent stylesheet
    // however we do not need this if it is empty
    // wp_enqueue_style('parent-style', get_template_directory_uri() .'/style.css');

    // enqueue the parent RTL stylesheet

    if (is_rtl()) {
        wp_enqueue_style('mfn-rtl', get_template_directory_uri() . '/rtl.css');
    }

    // enqueue the child stylesheet

    // wp_dequeue_style('style');
    wp_enqueue_style('style', get_stylesheet_directory_uri() .'/style.css');
}
add_action('wp_enqueue_scripts', 'mfnch_enqueue_styles', 101);

/**
 * Load Textdomain
 */

function mfnch_textdomain()
{
    load_child_theme_textdomain('betheme', get_stylesheet_directory() . '/languages');
    load_child_theme_textdomain('mfn-opts', get_stylesheet_directory() . '/languages');
}
add_action('after_setup_theme', 'mfnch_textdomain');

--------------------------------------------------
The style.css is pretty much empty, except for the initial description.

Comments

  • Hello,
    those are the steps.
    1. Update wordpress and the parent theme to the newest version.
    2. Download the childtheme from themeforest, and activate it.
    Then, any changes you make it the style.css file, will be reflected on the website.
    If you have any problems, there could be an issue with the plugins, which we suggest you disable for testing. Or you simply have CSS errors, and the code does not do anything.
    thanks
Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.