Skip to main content
There are several ways to integrate Locadapt with your WordPress site. We’ll cover three methods, from easiest to most advanced:

Method 1: Using a Plugin (Recommended for Beginners)

Method 2: Using the Theme Customizer

This method is suitable if you’re comfortable with basic WordPress customization.
1

Access Theme Customizer

Go to Appearance > Customize in your WordPress dashboard.
2

Add CSS

Navigate to Additional CSS and add the following:
@import url('https://cdn.locadapt.com/locadapt.min.css');
3

Add JavaScript

Go to Appearance > Theme File Editor and open header.php. Add the following code just before the closing </head> tag:
<script 
  src="https://cdn.locadapt.com/locadapt.min.js" 
  data-project-id="YOUR_PROJECT_ID"
></script>
4

Save Changes

Click “Publish” in the Theme Customizer and “Update File” in the Theme Editor.

Method 3: Using a Child Theme

This method is for advanced users comfortable with WordPress development.
1

Create Child Theme

Create a child theme if you haven’t already. This preserves your changes during theme updates.
2

Edit functions.php

In your child theme’s functions.php, add the following code:
function enqueue_locadapt() {
    wp_enqueue_style('locadapt-css', 'https://cdn.locadapt.com/locadapt.min.css');
    wp_enqueue_script('locadapt-js', 'https://cdn.locadapt.com/locadapt.min.js', array(), null, false);
    wp_add_inline_script('locadapt-js', 'document.currentScript.setAttribute("data-project-id", "YOUR_PROJECT_ID");');
}
add_action('wp_enqueue_scripts', 'enqueue_locadapt');
3

Save and Activate

Save the file and ensure your child theme is activated.
After implementing any of these methods, clear your WordPress cache if you’re using a caching plugin, and then test your site to ensure Locadapt is working correctly.
If you encounter any issues or need further assistance, don’t hesitate to contact our support team at [email protected].