• Resolved kmelv85

    (@kmelv85)


    Where can I remove the following code from the head section:

    <style type=”text/css”>.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>

    I’ve checked the files but can’t see it anywhere. Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    If you’re not using a Child Theme, and if the theme doesn’t have a designated section of the dashboard for CSS modifications then install this Custom CSS Manager plugin https://www.ads-software.com/plugins/custom-css-manager-plugin

    Then use its “CSS Code” section of the dashboard to hold your CSS modifications:

    Alternatively use your Child Theme style.css file to hold your CSS modifications:

    .recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}

    Thread Starter kmelv85

    (@kmelv85)

    The thing is I don’t need the recentcomments css – I haven’t added it anywhere myself, something is adding it to the head and I’d like to remove it.

    I don’t use comments on the site, just a very basic single page.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Sorry I misread, can you link the site with the issue?

    Thread Starter kmelv85

    (@kmelv85)

    Remove Recent Comments sidebar widget if you don’t use it. If you need this widget, then paste this code in your functions.php file:

    add_action( 'widgets_init', 'my_remove_recent_comments_style' );
    function my_remove_recent_comments_style() {
    	global $wp_widget_factory;
    	remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style'  ) );
    }

    Thread Starter kmelv85

    (@kmelv85)

    That’s great, thanks. I just prefer clean code!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove css from head’ is closed to new replies.