
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.

A WordPress YouTube shortcode that shows a thumbnail and loads the privacy-friendly youtube-nocookie player only when the visitor clicks play.

If you want to write external CSS the easiest way to sync the global colors between the oxygen and an external CSS is through the variables. You will need to get all variables into the header under the root. The output should look like this:

Add an ID column to the WordPress admin lists of posts, pages and custom post types, so you never open a post just to find its ID.

Accessing Oxygens Builder templates list always needs several clicks. WordPress Admin top bar is always there and easily accessible. If you don’t have too many things in the top bar this code will be perfect for you. With this code, you will get an entire list of your Oxygen templates. No styling is required as…

Register custom image sizes in WordPress and show them in the editor image size dropdown, from one config with name, width, height and crop.

A WordPress admin dark theme in a few lines of CSS: dark wp-admin screens and block editor UI, real colours for images and the editor canvas.

At the moment we have option to select pages on which you want to apply scripts. Thats why I made a small code snippet to help you create this option as well. Write Page, Post ID or Slug on witch pages you don’t want that script is applied and it will be applied on all…

Slow down the WordPress Heartbeat API and switch it off on the front end or in wp-admin, without breaking post locks or a plugin.

Change the WordPress widget title tag from h2 to h4 (or any heading) for every sidebar, keeping the theme’s classes and the title text as they are.

Remove “Category:”, “Tag:”, “Archives:” and the other prefixes from WordPress archive titles with one filter, in classic and block themes.

Color chosen WordPress admin menu items with your own background and text colours, so the screens you use daily stand out in the sidebar.

Give a WordPress custom post type the normal Categories and Tags and show those posts on category and tag archives, with or without Custom Post Type UI.

Rotate your WordPress site logo as the visitor scrolls, with a few lines of plain JavaScript that respect reduced-motion settings.

Show any taxonomy as a column in WordPress admin post lists, including custom post types, with one config array and no placeholders.

Give WordPress posts or custom post types a Parent field like pages, with register_post_type_args, safe for post types registered without supports.

Paste this into code block to get that data. Paste that data into Query of Easy posts or Repeater. With this, you can put in query data from ACF Pro as well Credits to: https://wpdevdesign.com/how-to-generate-the-query-string-for-easy-posts-in-oxygen/

Place it above Repeater or East Posts

Change the order of the WordPress blog and archive loop, for example oldest posts first, with pre_get_posts and without touching templates.
3rd party plugins actions admin admin bar archive block-themes block editor Blocks block styles block theme build core CSS custom post types Developer development filters full site editing gutenberg hook hooks Image img javascript load styles maintenance Must Have npm Oxygen performance php plugins scripts organizer security settings api single product tailwind theme.json Tips updates WooCommerce wordpress wp-cli wp-cron WP Admin