isotropic-2022
Share
Blog
Search
Menu

Alternative to functions.php using Oxygen Builder

By James LePage
 on July 15, 2020
Last modified on January 6th, 2022

Alternative to functions.php using Oxygen Builder

By James LePage
 on July 15, 2020
Last modified on January 6th, 2022

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;
} );Code language: PHP (php)

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:

Subscribe & Share
If you liked this content, subscribe for our monthly roundup of WordPress news, website inspiration, exclusive deals and interesting articles.
Unsubscribe at any time. We do not spam and will never sell or share your email.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Article By
James LePage
Contributors/Editors
notloggedin
James LePage is the founder of Isotropic, a WordPress education company and digital agency. He is also the founder of CodeWP.ai, a venture backed startup bringing AI to WordPress creators.
We're looking for new authors. Explore Isotropic Jobs.
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram