Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1388121
    gregrev
    Participant

    Hi,
    I am trying to remove the custom css code away from the header to help reduce code/text ratio for SEO purposes. I have read the forum in several places and followed some tutorials but I’m falling short at one stage. Note that I have x child setup and it’s been working for a while for other purposes.

    Here’s what I did:
    1- Copied the source code from my page that is contained after <style id=”x-generated-css” type=”text/css”> It includes all the custom code that I put in the customizer.
    2- Pasted it in x-child/style.css (after the commented section)
    3- Added the following function to the functions.php file in the x-child folder to remove the current code completely from the x-generated-css section.

    function x_output_generated_styles() {
     //Empty
    }

    This should have removed the code from the header and the css located in the style.css file should have kicked in, right? Instead, it looks like the function did its job since all my styling disappeared, but the css didn’t kick in.

    Any help would be appreciated. Website is http://www.azaltitudetraining.com

    Thanks much!

    Greg

    #1388429
    Darshana
    Moderator

    Hi Greg,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1388770
    gregrev
    Participant
    This reply has been marked as private.
    #1389650
    Lely
    Moderator

    Hello Greg,

    Thank you for the credentials. For discussion and guidance on how to achieve that, please do check this thread:https://community.theme.co/forums/topic/move-inline-css-to-external-file/page/2/

    Hope this helps.

    #1389665
    gregrev
    Participant

    Thank you, this is the thread I followed but it is not working 🙁 Not sure which step I’m missing. None of the code on page 2 of this thread worked.

    #1389965
    Lely
    Moderator

    Hi Greg,

    I can see your issue. The first code is correct:

    function x_output_generated_styles() {
     //Empty
    }

    Make sure to clear browser cache and your site cache too. Or try checking your site in Incognito mode.

    Hope this helps.

    #1390542
    gregrev
    Participant

    Well I had tried that in the past and it seemed like the css from style.css wasn’t kicking in (my site has no style at all). I just tried again and now it works… So I assume that the browser or site cache was the problem.
    Thanks for the help!

    #1390556
    Joao
    Moderator

    Glad to hear it,

    Cheers

  • <script> jQuery(function($){ $("#no-reply-1388121 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>