Style sheet in child theme not working

Hi,
I have have created some new classes and added to the style sheet in the Pro child theme but they do not seem to be referenced…can someone help me please… :frowning:

Hi There @dave.hicks

Thanks for writing in! First of all, make sure that you have setup your child theme correctly and activated it by following our guide here (https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57).

If you’re using a caching plugin, make sure to purge your server cache before testing your changes done.

If you’re still having issues, provide is with a link to your page along with the custom CSS that you have tried to use, so that we can check and assist you accordingly.

Thanks!

Hi there,

There are instances that the style.css of the child theme that gets rendered on the site will still be the cached version even after updating the file contents.

Here are some things you can do:

Kindly clear your browser cache after updating the style.css file to make sure that it is the updated resources that is getting rendered on the site.

function remove_wp_ver_css_js( $src ) {
    if ( strpos( $src, 'ver=' . get_bloginfo( 'version' ) ) )
        $src = remove_query_arg( 'ver', $src );
    return $src;
}

add_filter( 'style_loader_src', 'remove_wp_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'remove_wp_ver_css_js', 9999 );

Make sure that you are correctly referencing the elements by writing the correct CSS selector.

Please check this link for more information on how to write correct CSS selectors.

Hope these help.

Hi Jade,

So all is working after clearing the browser cache…

What exactly do the additional functions that you sent do?

Thanks for your help!! :smile:

Regards,

Dave.

Ps. I have added the new functions to the functions.php

Hi There,

That function will remove the version at the end of source codes. Many WordPress developers often display the WordPress version in the source code. But having this information publicly available makes it easy for attackers to exploit known vulnerabilities on a particular version.

Regards!

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