Alternative to functions.php using Oxygen Builder

Published: 10 months ago

The Oxygen Builder completely replaces your WordPress theme, meaning that if you become dependent on using the Functions.PHP file to add code, you're going to need to find an alternative. Luckily, there's an easy way to do this, which is what this mini tutorial is going to discuss.

If you're looking for an alternative to the functions.PHP file when using Oxygen Builder, chances are you're trying to add PHP code snippets to WordPress.

You can still access the functions.PHP, but it won't make any difference because Oxygen removes the need for a theme in WordPress. Because it doesn't load any of the assets associated with a theme, You can't use the functions.PHP file at all.

You may be scratching your head, asking “well how exactly do I add my code now?”.

There's a very easy way to do this, and in our opinion it's better than using functions.PHP.

How to add PHP code snippets to Oxygen?

To do this, we use a plugin called Code Snippets. By definition “Code Snippets is an easy, clean and simple way to run PHP code snippets on your site. It removes the need to add custom snippets to your theme’s functions.php file.”

This plugin is very helpful because it allows you to easily organize and categorize every single one of your code snippets. that means you can activate, deactivate, update, and delete each individual piece of code very easily. Not only is this simply a better way to do things, but it's the only way to incorporate the type of code that would be found on a functions.PHP file when using Oxygen Builder.

Let's run through how exactly to use this plugin.

Say you want to add this code to your WordPress admin header via PHP (this creates a html shortcode):

add_shortcode( 'shortcode_name', function () {

	$out = '<p>write your HTML shortcode content here</p>';

	return $out;
} );

First, download the code snippets plugin and activate it.

Once activated, head to the interface and add a new code snippet.

Paste the code into the input field, select where you want it to apply on the website, and then click save changes. The code will be activated and running on your website.

This completely removes the need for the functions.PHP file, and allows you to add code snippets and PHP directly into your Oxygen Builder website, even though it doesn't use any themes.

Psst! A new tool called Advanced Scripts was recently released -- it's like code snippets, but on steroids! Check out our review here:

Join Our Newsletter
Here's what you get: A once a week newsletter that contains original content, aggregated posts, WordPress deals, and anything else we think you'd like. We don't spam or sell your email address. Unsub at any time.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Affiliate Disclosure: Some links on this website are affiliate links. We make commissions for purchases made through those links.

We only recommend items/tools that we've personally used and like.

Full Disclosure | FTC Statement

Join Our Newsletter
Over 4,000 Design Lovers and Problem Solvers.

Author

A relationship driven website creation company.

Connect

© ISOTROPIC, LLC 2016-2021
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram