
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.

Make every published post of a WordPress custom post type private automatically, while drafts, trash and other post types work as usual.

1st Step Install and activate Code Snippets plugin. Add below code in code snippets: 2nd Step Edit the Oxygen Template that applies to woo single products. For the element you want to apply the “minimum 1 upsell” condition, click on Conditions icon then Set Conditions. Click “Add Condition” icon. Choose Dynamic Data condition. Under Advanced click PHP Function Return value. Function Name: wpl_check_upsell_product…

A WordPress reading time shortcode that counts the raw post words, skips blocks and shortcodes, and works in content and templates.

Add an Image column with the featured image to the WordPress admin lists of posts, pages and custom post types, without an extra image size.

Two WooCommerce shortcodes that show the cart total or item count anywhere in WordPress and update without a reload when products are added.

Exclude WordPress post types and taxonomies from the Slim SEO sitemap.xml with two filters, for helper post types nobody should find.

Are you Curious how to remove the slug of a custom post type in WordPress? If you’re using CPT UI, there’s an option called With Front but that doesn’t always seem to work. Follow this tutorial, add these two simple functions and the slug will be removed from your custom post type URL. Note –…

Remove the Category:, Tag:, Author: and Archives: prefix from WordPress archive titles with one filter, and keep it where you still want it.

A WooCommerce cart icon shortcode with the item count that links to the cart, updates over AJAX and works in block themes and builders.

For retrieving the best buying products in WooCommerce we are using wp_query manipulation with meta_key as “total_sales” and orderby “meta_value_num”. In short we are displaying products as per the total sales number. Here is Screenshot for repeater / easy posts Step 1 – Select Advance WP Query Step 2 – Setup Advance WP Query as…

Add a short text after the WooCommerce product price, for all products or chosen product IDs, on product pages and shop lists, escaped and valid HTML.

Oxygen does not support WordPress wp_body_open() and if you need to integrate Google Tag manager it requires two code parts. 1st part is Inside Head and 2nd is inside Body. Lucky Oxygen provides hook that is called: ct_before_builder. If you are using Scripts Organizer , Code Snippets or any other functionality plugins this script will…

Iconoir is one of the biggest open source libraries with currently 1007 SVG Icons. Really nice designed outline icons set done by Luca Burgio. Original Icons are exported as outlines. I have converted outline to fill and used IcoMoon App to make it as icon set ready for Oxygen. Download them and enjoy! Thanks to…

Run JavaScript once on page load and again on every resize in WordPress, throttled to one run per frame and without jQuery.

Fade in WordPress headings and other elements with GSAP autoAlpha, loaded from a pinned CDN, visible without JavaScript and with reduced motion.

Number cards, columns or any repeated items in WordPress automatically with a CSS counter: add one class to the block, no jQuery needed.

Add a class to any WordPress element after the visitor scrolls a set number of pixels, with plain JavaScript and no jQuery.
3rd party plugins admin admin bar archive block-themes block editor Blocks block styles block theme buttons Category core CPT CSS custom post types debugging development gutenberg hook hooks Image img javascript Must Have npm Oxygen performance php plugins react repeater rest api scripts organizer security settings api single product tailwind Taxonomy theme.json Tips updates WooCommerce wordpress wp-cli WP Admin