Home Forums ACF PRO Blocks with inline styles


Blocks with inline styles

  • For ACF blocks, do we have to add <style> tags in the block template if we want inline styles, or is there a way to use wp_add_inline_style() or something similar?

    For example, in the ACF block page, the following code appears in the template:

    <style type="text/css">
    #<?php echo $id; ?> {
        background: <?php echo $background_color; ?>;
        color: <?php echo $text_color; ?>;

    Now that might work, but aren’t we supposed to add inline styles to the <head> of a page when feasible, using the function wp_add_inline_style()?

    If so, how the heck do we do this? I can’t seem to get it to work.

    Thank you for any help!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.