How to remove Cornerstone’s styles from the head?

This is the reopening of the topic: How to remove Cornerstone's styles from the head?


How can I remove Cornerstone’s styles from the head of html?
I’m running Standalone Cornerstone ver.: 7.1.8.

I added filters in functions.php as stated in https://theme.co/docs/standalone-cornerstone#how-to-integrate-cornerstone-into-a-third-party-theme

Currently I have following filters without any success:
add_filter( ‘cornerstone_enqueue_styles’, ‘__return_false’ );
add_filter( ‘cornerstone_customizer_output’, ‘__return_false’ );
add_filter( ‘cornerstone_use_customizer’, ‘__return_false’ );


Kind regards.

Hi @dasbios,

Thanks for reaching out.
This issue was already reported by my colleague Christian, but unfortunately, there is no news till now. I will check with our development team about this and also add your thread so they will be aware of multiple reports.

Thanks

Hi @tristup,
Thank you for the information.

What is the timeframe of this fix?
My first report was 9 months ago.

Kind regards.

Hi @dasbios,

Unfortunately, we don’t have any news on ETA till now.

Thanks

I’ll start bringing back some of these filters in the next couple of releases. I’m not sure the optimizer one still is valid here, but cornerstone_enqueue_styles sounds useful. I was not aware this was feature in the past so I did rename, but I will also support the other name. If you have time, the below filter should remove a good portion of the generated CSS for Cornerstone Standalone and It would benefit me to know if there are other spots where this needs to be added. Let us know if you have any other questions too and have a great day.

add_filter("cs_use_standalone_theme_options", '__return_false');

I just tried. It did nothing.

Can I try something else?

If you haven’t tried the below line, this might help. But it might output other things instead. I see where it is also outputting and in a release or two cornerstone_enqueue_styles will work as it was before. Thanks for trying it out for me, at least it narrowed it down for me.

add_theme_support("cornerstone");

Hi, I tried. And no difference.

What should add_theme_support("cornerstone"); do?

It tells cornerstone that X or Pro is running essentially and doesn’t output it’s special styles. Or any theme that is handling these themselves, like your theme. It handles assignments differently and theme options too. If it didn’t help I’d leave it off unless you plan on getting really custom in the theme options. I’ll give you an update on the actual filter sometime this week. Probably a next week release thing.

I think I figured out why it was removed and or not included. There was a timing issue with hooks, but the following filter will remove the theme options inline css in the next release or Beta. Have a great day and let us know how we can help you in your custom theme.

add_filter( ‘cornerstone_enqueue_styles’, ‘__return_false’ );