> For the complete documentation index, see [llms.txt](https://docs.exoclick.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exoclick.com/tutorials/zh/jiao-cheng/fa-bu-shang-jiao-cheng/wordpress-exoclick-ad-zone-set-up.md).

# 如何在 WordPress 中使用 ExoClick 的广告位代码

将 ExoClick 的广告位代码集成到 WordPress 中很简单，并且可以通过多种方式完成。

本指南将带你了解四种不同的方法，帮助你将 ExoClick 广告位添加到你的 WordPress 网站中。

{% stepper %}
{% step %}

## 在 WordPress 中添加自定义 HTML 区块

进入 WordPress 编辑器

* 打开你想放置广告的文章或页面

<figure><img src="/files/71ad1fc352065a1972f7b222cbb52dd6eb31243f" alt=""><figcaption></figcaption></figure>

添加一个自定义 HTML 区块

* 点击 **“+”** （添加区块）按钮
* 搜索 **“自定义 HTML”** 并选择它

<figure><img src="/files/972f7225da56f9f857306642cad06d4d66f337d1" alt=""><figcaption></figcaption></figure>

获取你创建的广告位代码

* 复制 ExoClick 广告位代码

<figure><img src="/files/1f28c47d9fd94e1cc1cf0e9c909e5a01f6ea596f" alt=""><figcaption></figcaption></figure>

添加广告代码（横幅、原生广告等 - **不包括 popunder**)

* 将其粘贴到 **自定义 HTML 区块**

<figure><img src="/files/310430dbb979e02ca2175e5e255e915bcf5a2b4d" alt=""><figcaption></figcaption></figure>

现在你可以通过预览来测试广告

* 点击预览，检查广告是否正确显示
* 如果一切看起来都不错，点击 **发布/更新** 以保存更改

<figure><img src="/files/abe8948553bf666a3fe141d0c779637888e10e63" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## 使用 Ad Inserter 插件

安装 Ad Inserter 插件

* 前往 WordPress 仪表盘 > 插件 > 安装新插件
* 搜索 **“Ad Inserter”** 插件，安装并启用它

<figure><img src="/files/7ae126df78663092908b748680f17cf5f569f919" alt=""><figcaption></figcaption></figure>

获取你创建的广告位代码

* 复制 ExoClick 广告位代码

<figure><img src="/files/1f28c47d9fd94e1cc1cf0e9c909e5a01f6ea596f" alt=""><figcaption></figcaption></figure>

配置 Ad Inserter

* 前往 WordPress 仪表盘 > 设置 > Ad Inserter
* 将复制的广告代码粘贴到相应的代码块中
* 保存设置

<figure><img src="/files/5fdf1a051270de98d052b70490d86995976d8409" alt=""><figcaption></figcaption></figure>

在文章或页面中插入广告

* 编辑你想显示广告的文章或页面
* 使用 Ad Inserter 短代码 **\[adinserter blockID]** 在编辑器中
* 将 **blockID** 替换为在 Ad Inserter 中配置的区块编号

<figure><img src="/files/9f4cc0e9f9dd06658b5408cebeaa77ac406746ad" alt=""><figcaption></figcaption></figure>

如果一切设置正确，你现在应该能看到你的广告位

<figure><img src="/files/a47fb549df4c470ff6276d414527594d9d6b307e" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## 通过主题文件编辑器添加 Popunder 代码

* 前往 WordPress 仪表盘 > 外观 > 主题文件编辑器
* 找到 **footer.php** 在主题文件中
* 复制你的 Popunder 广告位代码

<figure><img src="/files/9b5a0b72a2033026d723d34ec607023b90b0ab8c" alt=""><figcaption></figcaption></figure>

* 将 Popunder 广告位代码粘贴到 **footer.php** 文件中

<figure><img src="/files/15dc0c7f8ed00b85c7fab5d4eb869b03b745c70a" alt=""><figcaption></figcaption></figure>

**注意**：你也可以使用 **方法 4** 将你的 Popunder 脚本添加到页脚。
{% endstep %}

{% step %}

## 使用在头部和页脚中插入脚本

访问设置面板

* 前往 WordPress 仪表盘 > 设置 > 在头部和页脚中插入脚本

<figure><img src="/files/640a7feed6e2e1285853e1820d5625f380a8c688" alt=""><figcaption></figcaption></figure>

**注意**：在此示例中，我们使用了 Popunder 广告位脚本
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.exoclick.com/tutorials/zh/jiao-cheng/fa-bu-shang-jiao-cheng/wordpress-exoclick-ad-zone-set-up.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
