• Resolved naturligtvismedia

    (@naturligtvismedia)


    I am currently working to get familiar with block themes, and doing som on twenty twenty four.

    There is an option called “position:” which can be set to Standard or Sticky. However, nothing happens when I use this option and I have tried it on several blocks and levels in the hirarchy.

    What am I doing wrong? I found a Youtube guide, which also states, that this option has no effect.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator jordesign

    (@jordesign)

    Hi @naturligtvismedia – generally I’d expect the Sticky option to work best for blocks at the very top level of the hierarchy.

    Are you able to share a link to a page where you have that set up but not working, and I can take a closer look?

    Thread Starter naturligtvismedia

    (@naturligtvismedia)

    I am only testing it locally at this moment, so no link to share unfortunately. But it is a basic installation of twentytwentyfour and I triend it on the top level block of the header (group).

    Moderator jordesign

    (@jordesign)

    @naturligtvismedia – in my tests I had to add an additional ‘group’ block at the top level, and apply the sticky positioning to that (instead of directly to the header).

    Could you please give that a try and see how it goes?

    Thread Starter naturligtvismedia

    (@naturligtvismedia)

    Thanks a lot, that worked!

    So instead of changing the “position:sticky” to the top level block in the header I have to put the hole header in a group and add the position to that group.

    I guess this is me not having fully emerged in to the block theme thinking yet, while I have been working with Gutenberg block builder for years now.

    Hello @jordesign ,

    is it possible to do this without editing every template page? Is it possible to edit header part so it would sticky globally?

    Hello @marcizus,

    It seems that “Position: sticky” has no effect if the group block is in a template part.
    See : https://github.com/WordPress/gutenberg/issues/47043

    @jpgoem

    Is it possible to still have a global header that appears on every page if I remove the template one?

    @lilgames,

    If you remove the header from a template, that header will disappear everywhere that template is used.

    In the site editor, edit each template where you want a sticky header (for example, the ‘Pages’ template) and group that header into a group, then set that new group as sticky. All pages that use the ‘Pages’ template will have the header sticky.

    You can also create an additional template for pages with sticky headers, and keep the original one for pages with fixed headers. Then choose which template to use for each page.

    Thank you! That worked!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.