0

I’m working on my first block theme and it’s giving me a lot of fun. I see there is a registered style in the block style tab to change the background image of the “row” block.. see the attached image below.

enter image description here

I’m looking for that feature to be added to the “header” block as well. I had the ability to register some custom styles for the selected block using the “register_block_style” function, but I was unable to add such a style using this PHP function. I also looked for a way to do this using theme.json. Unfortunately I still have no luck.

Hope somebody may help me out. Thank you.

2
  • what is the header block? The ability to set a background has nothing to do with block styles, it's something that a block supports, regardless of which style/variant of the block is in use. Also, avoid falling into the trap that every custom design must be its own new block, this is a mistake! Build your design units/sections as block patterns built from standard core blocks and insert those, only build blocks for the functional parts that core doesn't cover, never build a block purely for a particular design.
    – Tom J Nowell
    Commented May 15 at 9:17
  • @TomJNowell, Thanks for your commnet. what is the header block? Of course it should be heading... Sir, can you guide me to create such a block pattern?
    – thara
    Commented May 15 at 12:33

0

Browse other questions tagged or ask your own question.