Wordpress怎么加入广告功能

本文介绍如何使用AdInserter插件在Wordpress网站上轻松添加广告。通过详细步骤说明,包括安装插件、设置广告区块及位置等,帮助用户实现广告的有效展示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Wordpress怎么加入广告功能


请参考ad inserter官方文档

Quick start - https://adinserter.pro/documentation/quick-start

Code editing - https://adinserter.pro/documentation/code-editing

Common Settings - https://adinserter.pro/documentation/common-settings

Plugin installation

To install Ad Inserter Pro plugin check Plugin installation page. To install free Ad Inserter plugin log in to your WordPress dashboard, click on Plugins in the WordPress menu, click on Add New on top of the plugin page, search for ad inserter, select Ad Inserter from the results, click Install and then Activate the plugin. 

ad inserter install

First ad block

To go to plugin settings click on the left side Settings > Ad Inserter.

Practical example for settings for ad before the second paragraph on all posts:

  • Click on the block name and rename it to Posts
  • Enter <img src="https://via.placeholder.com/468x60/0000ff/ffffff.png?text=TEST"> into code widow
  • Set Automatic Insertion to Before Paragraph
  • Leave Posts checked, other page types should be unchecked
  • Set Paragraph(s) to 2
  • Click on Save Settings

ad inserter settings start

Now you can check your posts and you should see a test banner before the second paragraph. In the case there is no banner please check settings and other documentation and try to use debugging functions to diagnose the problem.

Ad Inserter menu item in the WordPress admin toolbar on the top of every post/page contains debugging functions that can help you to label inserted blocks and visualize available positions for automatic insertion:

ad inserter debugging functions

Quick info

Few very important things you need to know in order to display some ad:

  • Code block (there are 16 of them, 64 in Pro) is ad code with settings which define where the ad will be inserted (displayed).
  • Each code block can be renamed. Click on the name to edit it.
  • Use code tools to generate or edit code
  • Each code block has many independent insertion options, enable at least one:
    • Automatic Insertion (before/after paragraph,…)
    • Widget (for widget positions / sidebars, enabled by default)
    • Shortcode (for manual insertion of shortcodes in posts or pages)
  • Enable insertion on at least one WordPress page type (Posts, Static pages, Blog pages, Homepage, Category pages, Search Pages, Archive pages)
  • Please note that not all positions for automatic insertion are available on all page types – use debugging function Show positions to see what is available on particular page
  • For Posts and Static pages leave default blank selection value (no individual exceptions)

ad inserter single page exceptions

If you are using AdSense you may get blank (empty) ad blocks. This might be because there is some error in the code (wrong IDs), your AdSense account is not fully approved yet, your website was not accepted or your AdSense account is banned. In most cases once Google approves your account you’ll get ads. Check also Troubleshooting page for more information. You can also try Media net ads as good AdSense alternative for contextual ads, infolinks ads to complement existing ads or contextual in-stream video ads.

To display a list of all blocks click on the Blocks button in the header row.

ad inserter block list button

This list shows all active code blocks. To show all blocks click on the button with a dot. To filter blocks enter keywords in the search field. You can also use php, shortcode and widget keywords to filter blocks that have enabled respective functions.

ad inserter block list

以下是一个amazon的广告位样例代码

<script type="text/javascript">
    amzn_assoc_placement = "adunit0";
    amzn_assoc_search_bar = "true";
    amzn_assoc_tracking_id = "ad-inserter-20";
    amzn_assoc_search_bar_position = "top";
    amzn_assoc_ad_mode = "search";
    amzn_assoc_ad_type = "smart";
    amzn_assoc_marketplace = "amazon";
    amzn_assoc_region = "US";
    amzn_assoc_title = "Search Results from Amazon";
    amzn_assoc_default_search_phrase = "[adinserter data='smart-tag']";
    amzn_assoc_default_category = "All";
    amzn_assoc_linkid = "cf1873f027a57f63cede634cfd444bea";
    </script>
    <script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script>

请参考一下图片进行设置

效果图

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

LarryHai6

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值