
Copy-paste snippets for blocks, block themes, security, performance, Tailwind CSS, PHP and React. New snippets every Monday, Wednesday and Friday, each one run in a real WordPress before it is published.

Use JavaScript to hide element for one year. It’s perfect for banners such as cookie. You can easily change parameters and change it from 365 days to what ever you need. Your element need to have class of “element-dismiss” and you need to place button element inside

This will allow you to create a button that uses the history states to go back with pure HTML. You will then have to style it to make it look as required. It is useful if you end up on checkout pages or forms that have no headers or footers and wish to give the…

This allows you to hide that ruler on the bottom of the builder that often gets in the way of doing mobile responsive work. Set as CSS custom code

Put an Add Media upload link on the WordPress admin bar, in wp-admin and on the front end, for users who can upload files.

This is a snippet for Oxy Ultimate Woo plugin that allows you to change the default “No product in cart” to anything you like. Credit to the Developer, you can see the original code here

Fo those using Oxy Ultimate Woo Cart component, this is a snippet to change the text on the checkout button to anything you need. This is courtesy of the developer and work perfectly, see original here

Remove the Gutenberg block library CSS and global styles from the WordPress front end on classic sites, with a config for what to keep.

This can be placed in Oxygen code block or you can make it as short-code. It will display excerpt if user is not logged in or didn’t purchased specific product. Replace XXXXX with your product ID on line 9

Quite simply add this near the apply_filters or do_action.

Remove the WooCommerce Marketing menu from the WordPress admin and keep Coupons under the WooCommerce menu.

Make WordPress save every uploaded file with a lowercase file name, or only images, so URLs stay consistent on case-sensitive servers.

Oxygen page builder Image element does provide the feature to insert an Image-type custom field’s Alt text using the dynamic data. but if you need overwrite then see 2nd option. Step for show alt tag for image. Ensure that your Image field’s Return Format is set to Image Array in your ACF field group. Step 2 Option 1 Option…

Register a WordPress sidebar (widget area) so clients on Oxygen Builder sites can manage widgets under Appearance → Widgets without opening the builder.

Change the WooCommerce Add to cart button text on product pages and shop lists, without renaming Select options or out of stock buttons.

Change the WooCommerce Out of stock notice and the shop button of unavailable products to Sold out, without touching products on backorder.

Make the WordPress search match the post title only, not the content, on the front-end search page; wp-admin and other queries keep the normal search.

Change the WooCommerce Add to cart button to Add again? when the product is already in the cart, on product pages and in shop loops.

Remove the WooCommerce “has been added to your cart” notice and its View cart button with one filter, while other store notices keep working.
3rd party plugins actions admin archive block-themes block editor Blocks block theme build capabilities Category core CPT CSS Custom Post custom post types development filters full site editing gutenberg hook Image img load styles maintenance media mu-plugin Must Have npm Oxygen performance php plugins scripts organizer security settings api single product Taxonomy theme.json Tips updates WooCommerce wordpress wp-cli WP Admin