• Resolved jrcwp

    (@jrcwp)


    How can I remove the inline style section being added to the head section of every page [ie, the <style text/css>class, class, etc</style>.

    1) I use html5 so it should read only <style>.
    2) it inserts many lines of css when it would be better as a separate css file, ideally my own theme’s style.css.

    I can remove all the enqueued scripts via the recommended additions to the functions.php file [ add_filter( ‘wpcf7_load_js’, ‘__return_false’ ); and add_filter( ‘wpcf7_load_css’, ‘__return_false’ ); ]

    But doing so does not remove the added style section.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Switch to another theme or edit the current theme’s header template. Or, deactivate plugins if they are putting the inline style rules.

    Thread Starter jrcwp

    (@jrcwp)

    Takayuki:

    Thanks for the idea. The Contact Form 7 is the plugin that is adding styles in the head. As I indicated, the add_filter codes provided do remove the enqueued file links, but the plugin is adding simple <style> tags in the head, not as a link to a stylesheet.css. I only want that code for when the contact form is included, not on all other pages.

    John

    Thread Starter jrcwp

    (@jrcwp)

    This is the code being added during the wp_head action:

    
    <style type="text/css">
    div.wpcf7 .screen-reader-response {
      position: absolute;
      overflow: hidden;
      clip: rect(1px, 1px, 1px, 1px);
      height: 1px;
      width: 1px;
      margin: 0;
      padding: 0;
      border: 0;
    }
    div.wpcf7 .form-inline img.ajax-loader {
      display: inline;
    }
    div.wpcf7 .ajax-loader {
      visibility: hidden;
      display: inline-block;
      background-image: url('https://......./wp-content/plugins/contact-form-7/images/ajax-loader.gif');
      width: 16px;
      height: 16px;
      border: none;
      padding: 0;
      margin: 0 0 0 4px;
      vertical-align: middle;
    }
    div.wpcf7 .ajax-loader.is-active {
      visibility: visible;
    }
    div.wpcf7 div.ajax-error {
      display: none;
    }
    div.wpcf7 .wpcf7-display-none {
      display: none;
    }
    div.wpcf7 .placeheld {
      color: #888;
    }
    div.wpcf7 .wpcf7-recaptcha iframe {
      margin-bottom: 0;
    }
    div.wpcf7 input[type="file"] {
      cursor: pointer;
    }
    div.wpcf7 input[type="file"]:disabled {
      cursor: default;
    }
    div.wpcf7 .form-inline .form-group {
      max-width: 250px;
    }
    div.wpcf7 .input-group-addon img {
      height: 100%;
      width: auto;
      max-width: none !important;
      border-radius: 5px;
    }
    div.wpcf7 .input-group-addon.input-group-has-image {
      padding: 0;
    }
    </style>
    
    Thread Starter jrcwp

    (@jrcwp)

    The offender was located. Styles being added by plugin “Bootstrap for Contact Form 7.”

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Blocking Style Enqueue’ is closed to new replies.