Platform Guides
Step-by-step instructions for adding Earpocket to popular website platforms.
WordPress
Option 1: Theme Footer (Simple)
Add the script to your theme's footer.php file, just before </body>:
<script
src="https://widget.earpocket.com/embed.js"
data-site="YOUR_SITE_ID"
async
></script>
Option 2: Plugin (Recommended)
Use a plugin like "Insert Headers and Footers" or "WPCode":
- Install and activate the plugin
- Go to the plugin settings
- Paste the script tag in the "Footer" section
- Save changes
Option 3: Inline Mode with Theme Editing
For inline mode, edit your theme's single post template (single.php or similar):
<article>
<h1><?php the_title(); ?></h1>
<?php the_post_thumbnail(); ?>
<!-- Earpocket inline bar -->
<div data-earpocket></div>
<?php the_content(); ?>
</article>
Then add the script with data-position="inline" to your footer.
Option 4: Shortcode (Advanced)
Create a simple shortcode in your theme's functions.php:
function earpocket_shortcode() {
return '<div data-earpocket></div>';
}
add_shortcode('earpocket', 'earpocket_shortcode');
Then use [earpocket] in your posts where you want the bar to appear.
Ghost
Floating Mode
Add the script via Ghost's Code Injection:
- Go to Settings → Code injection
- Paste in the Site Footer section:
<script
src="https://widget.earpocket.com/embed.js"
data-site="YOUR_SITE_ID"
async
></script>
- Click Save
Inline Mode
For inline mode, you'll need to edit your theme:
- Download your current theme from Settings → Design → Change theme → Advanced
- Edit
post.hbsto add the marker:
- Upload the modified theme
- Add the script with
data-position="inline"via Code Injection
Wix
Floating Mode
- Go to your Wix Editor
- Click Add Elements (+) → Embed Code → Embed HTML
- Paste the script tag
- Position the element anywhere (it will float regardless)
- Publish your site
Inline Mode
- Go to your Wix Editor
- Navigate to your blog post template
- Click Add Elements (+) → Embed Code → Embed HTML
- Paste both the script and marker:
<script
src="https://widget.earpocket.com/embed.js"
data-site="YOUR_SITE_ID"
data-position="inline"
async
></script>
<div data-earpocket></div>
- Position the embed element where you want the bar
- Publish your site
Squarespace
Floating Mode
- Go to Settings → Advanced → Code Injection
- Paste the script in the Footer section:
<script
src="https://widget.earpocket.com/embed.js"
data-site="YOUR_SITE_ID"
async
></script>
- Click Save
Inline Mode
- Edit your blog post or page
- Add a Code Block where you want the bar
- Paste:
<div data-earpocket></div>
- Add the script with
data-position="inline"to Code Injection (Footer) - Save and publish
Webflow
Floating Mode
- Go to Project Settings → Custom Code
- Paste the script in the Footer Code section
- Publish your site
Inline Mode
- Add the script to Project Settings → Custom Code → Footer Code:
<script
src="https://widget.earpocket.com/embed.js"
data-site="YOUR_SITE_ID"
data-position="inline"
async
></script>
- In the Designer, add an Embed element where you want the bar
- Paste:
<div data-earpocket></div> - Publish your site
Next.js
Use the Script component in your layout or page:
import Script from 'next/script';
export default function ArticleLayout({ children }) {
return (
<>
{children}
<Script
src="https://widget.earpocket.com/embed.js"
data-site="YOUR_SITE_ID"
strategy="lazyOnload"
/>
</>
);
}
For inline mode, add the marker in your article component:
export default function Article({ content }) {
return (
<article>
<h1>{content.title}</h1>
<div data-earpocket></div>
<div dangerouslySetInnerHTML={{ __html: content.body }} />
</article>
);
}
Gatsby
Use gatsby-ssr.js to add the script:
export const onRenderBody = ({ setPostBodyComponents }) => {
setPostBodyComponents([
<script
key="earpocket"
src="https://widget.earpocket.com/embed.js"
data-site="YOUR_SITE_ID"
async
/>,
]);
};
For inline mode, add the marker in your blog post template:
export default function BlogPost({ data }) {
return (
<article>
<h1>{data.post.title}</h1>
<div data-earpocket></div>
<div dangerouslySetInnerHTML={{ __html: data.post.html }} />
</article>
);
}
Hugo
Add to your base template (e.g., layouts/_default/baseof.html):
<!DOCTYPE html>
<html>
<head>
{{ partial "head.html" . }}
</head>
<body>
{{ block "main" . }}{{ end }}
<script
src="https://widget.earpocket.com/embed.js"
data-site="YOUR_SITE_ID"
async
></script>
</body>
</html>
For inline mode, edit your single post template (layouts/_default/single.html):
{{ define "main" }}
<article>
<h1>{{ .Title }}</h1>
<div data-earpocket></div>
{{ .Content }}
</article>
{{ end }}
Jekyll
Add to your default layout (_layouts/default.html):
<!DOCTYPE html>
<html>
<head>
{% include head.html %}
</head>
<body>
{{ content }}
<script
src="https://widget.earpocket.com/embed.js"
data-site="YOUR_SITE_ID"
async
></script>
</body>
</html>
For inline mode, edit your post layout (_layouts/post.html):
---
layout: default
---
<article>
<h1>{{ page.title }}</h1>
<div data-earpocket></div>
{{ content }}
</article>
Static HTML Sites
Add the script just before </body>:
<!DOCTYPE html>
<html>
<head>
<title>My Article</title>
</head>
<body>
<article>
<h1>Article Title</h1>
<div data-earpocket></div>
<p>Content...</p>
</article>
<script
src="https://widget.earpocket.com/embed.js"
data-site="YOUR_SITE_ID"
data-position="inline"
async
></script>
</body>
</html>
What's Next?
- Configuration — All available options
- Inline Mode — Detailed inline mode guide
- Advanced Usage — Manual initialization and troubleshooting