Method 1: Using a Plugin (Recommended for Beginners)
Method 1: Using a Plugin (Recommended for Beginners)
This method is the easiest and doesn’t require any coding knowledge.
1
Install Plugin
Install and activate a plugin like “Insert Headers and Footers” from the WordPress plugin directory.
2
Access Plugin Settings
Go to Settings > Insert Headers and Footers in your WordPress dashboard.
3
Add Locadapt Code
In the “Scripts in Header” section, paste the following code:
Remember to replace
YOUR_PROJECT_ID
with the actual project ID provided in the configuration page for your Locadapt project.4
Save Changes
Click the “Save” button to apply your changes.
Method 2: Using the Theme Customizer
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:
3
Add JavaScript
Go to Appearance > Theme File Editor and open
header.php
.
Add the following code just before the closing </head>
tag:4
Save Changes
Click “Publish” in the Theme Customizer and “Update File” in the Theme Editor.
Method 3: Using a Child Theme
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: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.