---
description: How to use the Mazing Script to integrate projects into Wordpress
---

# Wordpress

### Overview

To prepare for the WordPress script integration you first have to install a Header / Footer Code Snippet Plugin, afterwards, you can enter your Mazing Script Integration Code into this script. Please be sure to first follow the [button-integration](../integration-types/button-integration "mention") guide, so you have a glimpse how our feature can work for you.

### Step 1: Install Header/Footer Plugin to WP

At first, you have to install a plugin, that lets you input custom Header and Footer code. The header code is used to integrate the mazing tag itself, so that mazing commands are available globally in your shop, the footer command is to place the 3D/AR buttons on your product pages. \
\
In this demo case we have choosen to install [WPCode](https://wordpress.org/plugins/insert-headers-and-footers/), but feel free to select whichever Custom Code Plugin you prefer.&#x20;

<figure><img src="https://3497237590-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzFDCBJYsAI1jsAj4WvF%2Fuploads%2FAaFJrmzIojyvAmBrlxt8%2Finstall_wp_code.png?alt=media&#x26;token=56b6c2cd-8ccb-4ed4-9dfb-3c6f45d768bd" alt=""><figcaption><p>WP Code Installation page</p></figcaption></figure>

### Step 2: Navigate to the settings after plugin activation

<figure><img src="https://3497237590-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzFDCBJYsAI1jsAj4WvF%2Fuploads%2FW6VuGRdfUSX01Xkeugpg%2F2_side_menu.png?alt=media&#x26;token=40962539-ab24-4065-a7f5-03c90da73d43" alt=""><figcaption><p>Side Menu in wp-admin</p></figcaption></figure>

### Step 3: Insert Mazing Code into the header

Add the header code from [button-integration](../integration-types/button-integration "mention") into the plugin and press save. \
\
**IMPORTANT: don't forget the \<script> \</script> Tags**

<figure><img src="https://3497237590-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzFDCBJYsAI1jsAj4WvF%2Fuploads%2Fty81ySweYcWMKr9Wa4kD%2F3_add_in_header.png?alt=media&#x26;token=a69e98c4-0371-4864-9cc4-72e3cec482be" alt=""><figcaption><p>Header Code</p></figcaption></figure>

### Step 4: Adapt your mazing code snippet&#x20;

If the header code is now enabled you can open the developer console in your WP page with F12. In the console, you can pretest your implementation by calling the globally exposed mazing() method now. And test the custom implementation you created from  [button-integration](../integration-types/button-integration "mention").

<figure><img src="https://3497237590-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzFDCBJYsAI1jsAj4WvF%2Fuploads%2FOmFvHiS6sKqjskBGFSES%2Ftester_deve_console.png?alt=media&#x26;token=c6a2b874-9416-4bed-9890-0baed74cd6b6" alt=""><figcaption><p>Test your script and the placement of the 3D/AR buttons</p></figcaption></figure>

### Step 5: Integrate your final snippet into the footer

After you are happy with your custom development, integrate the script into your footer with the WPCode plugin, like you did with the header and press "Save". \
\
**IMPORTANT: don't forget the \<script> \</script> Tags**

<figure><img src="https://3497237590-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzFDCBJYsAI1jsAj4WvF%2Fuploads%2F87amRyBHgWBfULHg4yTx%2F4_add_in_footer.png?alt=media&#x26;token=36b309a2-03d2-483d-b3e5-754fff0ab5ee" alt=""><figcaption><p>Footer Code Implementation</p></figcaption></figure>

### Step 6: Enjoy your freshly created shop integration.
