Skip to content

GenerateStuff

GeneratePress & GenerateBlocks how-to tutorials.

  • Home
  • Contact

Uncategorized

Dynamically set custom property –masthead-height

I wanted this in order to properly set scroll-padding-top for ‘Back to Top’ and other anchor links. I like setting my primary navigation to Float Right, so when displays get narrower, often the hamburger menu slides down under a wide logo or Site Name, changing the height of the #masthead. This makes setting a static …

Read more

Categories Uncategorized Tags Custom Properties, JavaScript

Enable ACF Shortcodes

Since v6.3.0, Advanced Custom Fields (ACF) disables shortcodes by default. Use this snippet to enable them. This will enable using ACF fields to display dynamic data in WYSIWYG, like

Categories Uncategorized Tags Advanced Custom Fields (ACF)

Enqueue child theme stylesheet (and Customizer CSS) in block editor

What the title says – this snippet will enqueue your child theme’s stylesheet into the block editor so you can preview changes in real time. Credit: Alvind with GeneratePress support. This next snippet will also enqueue your CSS from “Additional CSS” in the Customizer. (credit GP site)

Categories Uncategorized Tags GeneratePress, PHP Snippets

Setting default button attributes

Several things are happening in this example: Addendum: this snippet by itself would add the gb-button class to every button by default.

Categories Uncategorized Tags GenerateBlocks
Copyright © 2025 GenerateStuff.com All Rights Reserved.