• Resolved Anonymous User 7658014

    (@anonymized_7658014)


    I ran into an issue with this otherwise lovely theme: Lovecraft hooks its stylesheets into wp_print_styles while they should be enqueued via wp_enqueue_scripts.

    Enqueuing stylesheets properly gives plugins like Simple Custom CSS a chance to hook in after all theme stylesheets have been loaded, so they can be overridden with custom styles via the plugin. (I usually go for a child theme, but this time had to be quick and dirty.)

    A rewrite of how lovecraft_load_style() is hooked could fix the issue:

    function lovecraft_load_style() {
    	wp_enqueue_style( 'lovecraft_googleFonts', '//fonts.googleapis.com/css?family=Lato:400,700,900|Playfair+Display:400,700,400italic' );
    	wp_enqueue_style( 'lovecraft_genericons', trailingslashit( get_stylesheet_directory_uri() ) . 'genericons/genericons.css' );
    	wp_enqueue_style( 'lovecraft_style', get_stylesheet_uri() );
    }
    add_action( 'wp_enqueue_scripts', 'lovecraft_load_style' );

    Would love to see something like this in the next compatibility update of the theme.

    Thanks,
    Caspar

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi Caspar,

    Thanks for pointing this out, and sorry for the late reply. I’ve submitted an update that fixes this issue.

    — Anders

    Thread Starter Anonymous User 7658014

    (@anonymized_7658014)

    Hey, Anders, thanks so much! Topic ist resolved.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Theme stylesheets hooked into wp_print_styles cause issues with plugin’ is closed to new replies.