zoukankan      html  css  js  c++  java
  • 黄聪:让wordpress模板完全整合google AdSense搜索广告

    wordpress中自定义AdSense搜索广告的示例

    wordpress中自定义AdSense搜索广告的示例

    1. 正确生成AdSense搜索广告代码。这里有几处需要注意的内容:(以下全部假设博客网址为http://www.qiuworld.com)
      选定的网站:指定要搜索的网站或网站列表时填写自己博客的网址,如:http://www.qiuworld.com。
      打开搜索结果页:选择在“我的网站上打开搜索结果”选项,并输入显示搜索结果的网址,如:http://www.qiuworld.com/search/
    2. 下载并安装Google Custom Search Plugin,将生成的代码分别填入该插件的设置(Google Custom Search Configuration)页的Search Box和Search Results当中。搜索框代码填入Search Box当中,搜索结果代码填入Search Results框当中。并保存更改。
    3. 寻找到原模板当中的搜索框代码段,使用google搜索广告生成的代码替换原代码。并将搜索广告代码放入以search-form命名的层内。示例如下:
      <div class=”search-form”>
      <form action=”http://www.qiuworld.com/blog/search/” id=”cse-search-box”>
      <div>
      <input type=”hidden” name=”cx” value=”partner-pub-3900138411736885:i29mpk-hll4″ />
      <input type=”hidden” name=”cof” value=”FORID:10″ /> <input type=”hidden” name=”ie” value=”GB2312″ />
      <input type=”text” name=”q” size=”60″ />
      <input type=”submit” name=”sa” value=”&#x641c;&#x7d22;” />
      </div> </form> <script type=”text/javascript” src=”http://www.google.com/cse/brand?form=cse-search-box&amp;lang=zh-Hans”></script>
      </div>
    4. 使用CSS文件控制搜索表单的显示。示例如下:
      /************************************* +Search form *************************************/
      .search-form {
      font-size:1.2em;
      background:url(images/search.png) no-repeat;
      position:relative;
      147px; height:44px; margin-bottom:10px;
      }
      /****************这里设置了搜索输入框的宽度,边距,边宽以及背景色******************/
      .search-form input{
      125px;
      margin:14px 0 0 10px;
      border:0px;
      background:#f9f9f9;
      color: #454545; }
      /******************用于隐藏输入提交按钮*******************/
      .search-form input[type="button"],.search-form input[type="submit"]{
      display: none;
      border: none;
      color:transparent;
      }

    这样基本就设置完毕了。

  • 相关阅读:
    Linux:目录结构
    Linux安装日志(anaconda-ks.cfg、install.log、install.log.syslog)
    Docker:Dockerfile基础知识
    Docker:容器数据卷
    多线程设计模式:两阶段终止模式
    多线程:Thread中的常见方法
    多线程:查看进程线程方法
    多线程:创建线程
    Apollo:工作原理 核心概念
    Apollo:环境搭建
  • 原文地址:https://www.cnblogs.com/huangcong/p/1701701.html
Copyright © 2011-2022 走看看