wpcodebox code snippets wordpress

WPCodeBox: code management in your WP

For developers, and many times for admins too, it becomes necessary to add code to our site. That code can be CSS, additional functionality in PHP, and even JavaScript. There are many ways to achieve this, almost always discouraged. But, for those who want a well managed and clean site, there is WPCodeBox.

What's so special about WPCodeBox? This plugin for WordPress allows us save code snippets in the cloud. Thus, not only are they safe from Theme updates, builders and a long etcetera, but also, since they are in the cloud, we can share these codes with all our WordPress sites. We tell you its details in this guide.

Introduction

A snippets is defined as a piece of code (a “mini plugin”?) that allows us to modify or add something to our site dodging heavier usage of an entire plugin. In the case of PHP in particular, adding (or removing) functionality is usually done by editing the file functions.php of our topic. For JS, they usually require a plugin that allows us to inject code in the header, body or footer. And the CSS depends: some plugins and Themes support changing or adding CSS on their own settings page; by default, at the very least, we have the WordPress Customizer.

WPCodeBox emerges as an evolved alternative: it allows us to gather all the changes and inclusions in one place, and that place is outside our site if we wish.

But the plugin is not "only" with this premise. It is, at the same time, an online library of third-party snippets; namely, a repository of features ready to be added to our WordPress site(s). These predefined snippets in the WPCodeBox repository cloud can be applied directly or modified according to our needs. The concept, to say the least, is surprising.

Let's take a look at its editing screen.

Editing Snippets with WPCodeBox

Whether we need to write our own code, download it from the WPCodebox repository (noted in the screenshot above), or copy and paste it from a Google reference, this is the creation screen.

The code snippet can be one of six types: PHP, CSS (plus external option), SCSS, LESS and JavaScript (plus external option) and plain text.

How and where do we want to run our snippet?

Easy, we choose the desired option in the editing field.

Both properties of execution are perfect to execute the piece of code that we have created. Using the 'Always (On Page Load)' option our snippet will be executed after loading our content. The 'Manual (On-Demand)' alternative will run the snippet only when we press the Run button shown in the screenshot below. This is for testing purposes, and our snippet must be saved BEFORE hitting Run.

On the other hand, the “Where to run the snippet” dropdown allows you to choose the output space: throughout the site, only on the frontend, only on the WordPress Dashboard or customized, where we will choose the spaces to taste through the conditional constructor (lower shot).

Saving our snippet in the cloud

Sending our code snippet to the cloud is easy: just one click.

Our cloud snippets will be listed here:

Snippet repository

The Snippets repository is the place to find predefined snippets.

After clicking on the indicated button, we will see the following screen.

Here we can choose a category and see what destiny offers us, or perform a search to find the right snippet of what we're needing. Once the desired code snippet has been identified, we can download it with one click. From then on, said snippet will be displayed in the editing panel.

Conclusions

WPCodeBox allows us to insert codes, our own and others, decide how they will be executed and where, send them to the cloud and have everything ready to be used in other own sites.

It saves us from using additional plugins by bundling so many features into a single plugin. WPCodeBox keeps our site tidy, preventing us from reaching where we shouldn't (read editing Theme files like functions.php).

This plugin allows us to strictly use the necessary code, reducing the load of our website (for example, preventing us from downloading plugins to achieve things that a small snippet fixes). Also, we can enable and disable the snippets with one click, very easy to test.

The repository is minimalist, of course, with a consistent design. It allows us to add already custom functions with full control over the snippets. Managing snippets with WPCodeBox is super easy, clean, and fast. For all these reasons we include it for free in our Managed WordPress.

We read and reply to all messages. Good luck, and thanks for reading.

We take care of the maintenance of your site

We include WPCodeBox in our Managed WordPress service


Duplika

Duplika

We are online, we are not a bot :)

I will be back soon

Duplika
Hi 👋
Select the prefered contact method to get in touch.
Connect via:
chat