• Resolved almcr

    (@almcr)


    been checking out Gutenberg and one of the themes described on themeshaper.com. a recent article introduced us to 3 “gutenberg” themes, one of theme being a theme called handicraft.
    This is a link to that article “Styling Themes for Gutenberg“`

    this might be more of a general wordpress question than gutenberg related but it does relate to using the theme handicraft. how does the internal css get generated in the head of this theme which displays the background image on the page?

    This the CSS code generated just before the end of the head, where from??

    <style type="text/css" id="custom-background-css">
    body.custom-background {background-image: url("images/papertexture.jpg"); 
    background-position: left top; 
    background-size: auto; 
    background-repeat: repeat; 
    background-attachment: scroll;}
    </style>

    Al

    • This topic was modified 6 years, 8 months ago by almcr.
    • This topic was modified 6 years, 8 months ago by almcr.
Viewing 2 replies - 1 through 2 (of 2 total)
  • In general, CSS in the head of your HTML will be put there by either a plugin or theme, by hooking into the wp_head() action hook. As to where the CSS is being SET, that could be many places: the Customizer, plugin settings, separate theme settings, etc. Currently, Gutenberg block styling (even for shared blocks) is added as inline CSS on the exact element you are styling so what you are seeing probably isn’t an output from Gutenberg.

    Thread Starter almcr

    (@almcr)

    // Set up the WordPress core custom background feature.
    add_theme_support( 'custom-background', apply_filters( 'handicraft_custom_background_args', array(
    'default-color' => 'ffffff',
    'default-image' => get_template_directory_uri() . '/assets/images/papertexture.jpg',
    ) ) );

    this is code from the theme handicraft functions.php file and is used to generate that css. didn’t realize this is what that did. this mystery solved, I am just a dabbler in wordpress, certainly not a professional, and like poking around and playing in the wordpress world.

    thanks Al

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘where does this code come from??’ is closed to new replies.