Do I need a child theme?

We updated our theme lately into latest version but the child theme’s styles are not working. I am planning to just put it in the main theme. Question: Is using child theme still recommended or I can safely put my custom css to the main theme?

Hi @prism,

Thanks for reaching out.
If you are using custom CSS code in the style.css, it is strongly recommended to use the child theme. Please remember modified parent theme does not come under the Theme Support.

Thanks

Hi Thank you for your reply, Now that I use the parent theme, I put the css code on wordpress admin Dashboard > Theme > customize > additional css
Will the css disappear when I update theme in the future?

Hello @prsmvmnt,

I would highly recommend that you stick with your child theme. There could be modified files and other customizations that you have will be gone once you switch to the parent theme. We will just solve first why the styling is not loaded in your child theme. It could be just caching. To better assist you with your issue, please provide us access to your site so we can check your child theme. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

1 Like

Ok I will provide the access to the site

Hello @prsmvmnt,

Just as I have though, you were using a Legacy child theme. You must do the following to update it:
1.) In your child theme’s style.css, you need to remove this line:
@import url( '../x/framework/css/site/stacks/integrity-light.css' );

2.) In your child theme’s functions.php file, you must update it into this:

<?php

// =============================================================================
// FUNCTIONS.PHP
// -----------------------------------------------------------------------------
// Overwrite or add your own custom functions to Pro in this file.
// =============================================================================

// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
//   01. Enqueue Parent Stylesheet
//   02. Additional Functions
// =============================================================================

// Enqueue Parent Stylesheet
// =============================================================================

add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );



// Additional Functions
// =============================================================================
// 
if (function_exists('register_sidebar')) {

			register_sidebar(array(
			'name' => __('Header Tagline','avada-framework' ),
			'id'   => 'header_tagline',
			'description'   => __( 'These are widgets for the header tagline.','avada-framework' ),
			'before_widget' => '<div id="%1$s" class="widget %2$s">',
			'after_widget'  => '</div>',
			'before_title'  => '<h3 class="title"><span>',
			'after_title'   => '</span></h3>'
		));

}

3.) And then your _navbar.php ( framework/views/global/_navbar.php) file must be relocated to wp-content/themes/x-child/framework/legacy/cranium/headers/views/global/

Kindly let us know how it goes.

1 Like

on the third step, should I do it using cpanel / ftp?

Edit: I am done with all the steps, also moved the file using ftp. The style.css in child theme is already working thanks so much.

follow up question: When I activated the parent theme last time, the alignment of logo is correct. but when I activated the child theme, the logo is in the very left

Hi @prsmvmnt,

It will be very difficult to recognize the problem without seeing the previous position, still, you can add some spaces to the left of logo by adding some margin to the left in the style.css file of your child theme.

.x-navbar .x-brand 
{
    margin-top: 13px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1008;
}

You can add the following line to add the margin to the above code.

    margin-left: 10px;

Please remember that the above code will work if copied as it is and doesn’t conflict with any existing style.
Please note that the code provided serves only as a guide to help you get started custom coding on your own if there’s no option offered in our theme or the products we bundle.
We really do not provide support for custom codes which means we can’t fix it in case it conflicts with something on your site nor will we enhance it. Further customization should be directed to a third-party developer or you can avail of One, where we answer the questions beyond normal theme support.

Thanks

Ok I just thought there are some differences with framework of the new version vs the old that is why it happened. I will follow your advice to just add css to it, thanks!

Hi @prsmvmnt,

You are most welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.