• Resolved alienfactory

    (@alienfactory)


    I have some block css i am trying to get work but it does not load on the frontend,
    the backend is working fine

    here are the files i have tried
    block-anchor-block.php (for reference)
    block-anchor-block.css(worked backend only)
    also created two styles to see if the would work but no luck
    block-anchor-block.css (did not work)
    preview-anchor-block.css (worked)

    Then I created a global blocks.css and that does not work on the frontend either

    Is there something i am missing

    • This topic was modified 5 years ago by alienfactory. Reason: made mistake
Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @alienfactory,
    Thanks for letting me know about that.

    Where are those stylesheets?

    1. Parent theme
    2. Child theme
    3. Simple theme (not a parent or child)
    4. Plugin

    Thread Starter alienfactory

    (@alienfactory)

    it is locaked in {mytheme}/blocks/block-anchor-block.css

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    OK, thanks. That’s not a parent or child theme, right?

    Thread Starter alienfactory

    (@alienfactory)

    no just a standard theme

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    OK, thanks

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Are you developing this in a local environment now?

    If so, could you please try on the command line:

    wp shell
    clearstatcache()

    Block Lab uses file_exists() to check if the stylesheet exists, but that function is cached.

    So clearstatcache() should clear that cache.

    Thread Starter alienfactory

    (@alienfactory)

    ok dont mark this closed i am having issue with getting in to the wp shell keeps saying Error establishing a database connection once i resolve i will let you know if that worked

    but on a side note i am having the same issue on the live site when i tested it

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    OK, thanks. Let me know when ‘Error establishing a database connection’ is resolved.

    Thread Starter alienfactory

    (@alienfactory)

    ok i am getting a => NULL when running clearstatcache() is that the expect response

    but id i run the file_exists(‘wp-content/themes/thisisitdesign/blocks/block-anchor-block.css’);

    i get a true back

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Thanks!

    Yeah, null is what I got from clearstatcache() also.

    but id i run the file_exists(‘wp-content/themes/thisisitdesign/blocks/block-anchor-block.css’);

    i get a true back

    OK, thanks. Does this issue still exist?

    Thread Starter alienfactory

    (@alienfactory)

    yes the issue still exist

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    OK, sorry for the delay.

    For now, enqueuing the stylesheet on the block_lab_render_template_* hook should work:

    https://github.com/getblocklab/block-lab/blob/bd9c9125db0f1736497fbbbf2c75d78f0b816339/php/blocks/class-loader.php#L408

    For example:

    
    add_action(
    	'block_lab_render_template_anchor-block',
    	static function() {
    		wp_enqueue_style(
    			'example-stylesheet-slug',
    			// Path to stylesheet
    		);
    	}
    );
    

    Of course, I’ll also work on reproducing and ideally fixing the issue in Block Lab.

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    This issue isn’t fixed, but I’m closing this as there’s no immediate action.

    I’ll keep this in mind, in case a bug in loading stylesheets comes up that I can reproduce.

    Thread Starter alienfactory

    (@alienfactory)

    ok one other note i was thinking it was a php version issue so i change to the letest version 7.4 and now i white screen with ctritical error message when i use a block lab block.

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Uf, what is the error message?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘CSS frontend not loading’ is closed to new replies.