
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.

after the file path add array, version and then print An entire block stored in function.php should look like this. You can always add it as @media print but with this you will have much more flexibility and load it where you need it. More about Print CSS: https://www.sitepoint.com/css-printer-friendly-pages/ https://www.smashingmagazine.com/2018/05/print-stylesheets-in-2018/

Change the WordPress excerpt length from 55 words to any number, with an optional length per post type, in one small filter.
![Change the WordPress Excerpt […] to a Read More Link](https://code.dplugins.com/wp-content/uploads/2020/01/post-143-thumbnail-1.jpg)
Replace the […] at the end of WordPress excerpts with an accessible Read more link to the right post, escaped and translatable.

List WordPress related posts from the same category under a single post, without the current post and without a plugin.

In code block when you are using script add to PHP tab: You need to put path from /wp-content/ and not just plugins folder PHP JavaScript Note: Got this trick from a good friend Alexander Buzmakov. Visit his tutorials oxywp.com.

Put this code to functions.php The easiest way to find all registered scripts and styles is with the plugin MinQueue. If you want to deregister with plugin use Asset Queue Manager

Open preferences by pressing Command + “,” And paste the following snippet Taken from: https://gist.github.com/supawaza/8009192

List the categories of the current WordPress post as escaped links on a single post template, with a class on the primary category.

Show the custom taxonomy terms of the current WordPress post on its single template, as links with a CSS class per term for badges.

Highlight the search terms in WordPress search results: wraps the words in titles and excerpts in , in classic and block themes.

A WordPress back button shortcode that returns visitors to the previous page, and opens a fallback URL when they arrived from another site.

Add an is-visible class to WordPress elements while they are on screen and remove it when they leave, with IntersectionObserver and no jQuery.

List all WordPress categories or custom taxonomy terms as links with a current-cat active class, on archives and on single posts.

Swap an element’s text between two values on each click in WordPress, keyboard accessible and without jQuery.

Slide content open and closed on click in WordPress with plain JavaScript instead of jQuery slideToggle, keyboard accessible and motion aware.

This code is basic and for beginners. Usually, you can see solutions but not how to wrap jQuery code to start writing it for WordPress or Oxygen. The outer Javascript function is known as an anonymous function and jQuery is wrapped at the end, so is therefore aliased or bound to the $ selector, so in the inner function…
3rd party plugins actions admin admin bar archive block-themes block editor Blocks block styles block theme build core CSS custom post types debugging development gutenberg hook hooks Image img javascript load styles media Must Have npm options Oxygen performance php plugins production react rest api scripts organizer security single product theme.json Tips updates WooCommerce wordpress wp-cli wp-cron WP Admin