
WordPress code snippets for hooks, custom post types, the REST API, WP_Query, admin screens and more. Copy, paste and adapt.

Print Google Tag Manager or any other script right after the opening body tag in WordPress with the wp_body_open hook, no theme edits.

Change or remove the WordPress password protected message, add a link to request the password, and keep it working on translated sites.

Stop WordPress from creating the medium_large, 1536×1536 and 2048×2048 image sizes for every upload, and keep the sizes you use.

Sometimes when you are in a development environment like Laravel Valet on your home computer, you may have errors show up. you can use the following code to hide them Edit wp-config.php file and add the following anywhere ini_set(‘display_errors’,’Off’); ini_set(‘error_reporting’, E_ALL ); define(‘WP_DEBUG’, false); define(‘WP_DEBUG_DISPLAY’, false);

Use the following code to add extra required classes during Oxywind worker compiling / cache generation when you are ready for production. You may want to do this if you want to use tailwind classes in your HTML code outside of oxygen elsewhere in wordpress or a 3rd party / custom plugin. This will save…

Setup daisyUI CDN Ready For Development Add the following code to use the full daisyUI CDN while developing, this includes all daisyUI elements. These will be later purged by the Oxywind worker so only the elements you use will be included in your production site. Add daisyUI To Oxywind Worker Configuration In the Oxywind settings…

This is taken form Facebook conversation in the Official Oxygen Builder group. Follow up on the conversation.

A WordPress shortcode that shows the terms of any taxonomy as links, limited to a number you choose, with escaped output and no PHP warnings.

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.

Quite simply add this near the apply_filters or do_action.

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…

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.

Sometimes you have a situation where you want the customer to log in, like a donation page, but you don’t want them to end up at /my-account/ but rather be taken back to the page where they were when they started. This code is useful for donation sites, as well as refer a friend scenarios.
3rd party plugins actions admin archive block-themes block editor Blocks block theme build capabilities core CSS Custom Post custom post types Developer development filters Front End full site editing gutenberg hook Image img load styles maintenance media mu-plugin Must Have npm Oxygen performance php plugins scripts organizer security SEO settings api single product theme.json Tips updates WooCommerce wordpress wp-cli WP Admin