宇宙主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

欧基零壹微头条IP归属甄别会员请立即修改密码
查看: 1927|回复: 8

【已解决】统计代码应该加到哪个位置?

[复制链接]
发表于 2018-1-30 11:55:13 | 显示全部楼层 |阅读模式
本帖最后由 qwer 于 2018-1-30 12:01 编辑

This footer.php
  1. <?php
  2. /**
  3. * The template for displaying footer
  4. *
  5. * @since 1.0.0
  6. * @package Coolbox
  7. */

  8. if ( cd_is_amp() ) :
  9.         cd_addon_amp_footer();
  10. else :
  11. ?>

  12. <footer id="footer" class="footer">

  13.         <?php cd_footer_menu(); ?>

  14.         <div class="footer-bottom">

  15.                 <div class="container">

  16.                         <div class="copyright">

  17.                                 <p>
  18.                                         <?php
  19.                                         $allowed_html = array(
  20.                                                 'a'      => array(
  21.                                                         'href'    => array(),
  22.                                                         'onclick' => array(),
  23.                                                         'target'  => array(),
  24.                                                 ),
  25.                                                 'p'      => array(
  26.                                                         'style'  => array(),
  27.                                                         'align'  => array(),
  28.                                                         'target' => array(),
  29.                                                 ),
  30.                                                 'br'     => array(),
  31.                                                 'strong' => array(),
  32.                                                 'b'      => array(),
  33.                                                 'small'  => array(),
  34.                                         );
  35.                                         ?>

  36.                                         <?php echo wp_kses( cd_credit(), $allowed_html ); ?>
  37.                                 </p>

  38.                                 <?php if ( cd_is_theme_credit() ) : ?>
  39.                                         <p>
  40.                                                 <?php echo wp_kses( cd_theme_credit_text(), $allowed_html ); ?>
  41.                                         </p>
  42.                                 <?php endif; ?>

  43.                         </div>

  44.                         <?php cd_social_links(); ?>

  45.                 </div>

  46.         </div><!--/.footer-bottom-->

  47.         <a id="back-to-top" class="noscroll" href="#"><span class="chevron-up"></span></a>

  48. </footer>

  49. <div class="modal-search-form"><?php get_search_form(); ?><div class="close-toggle"><span class="top"></span><span class="bottom"></span><span class="label">Close</span></div></div>


  50. <?php wp_footer(); ?>
  51. </body></html>

  52. <?php endif; ?>
复制代码


这是统计代码

<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?xxxxx";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
</script>

发表于 2018-1-30 11:56:12 | 显示全部楼层
随便找个位置放进去啊。
发表于 2018-1-30 11:56:50 来自手机 | 显示全部楼层
</body></html> 前面
 楼主| 发表于 2018-1-30 11:57:34 | 显示全部楼层
南琴浪 发表于 2018-1-30 11:56
随便找个位置放进去啊。

随便放吗。~~我在网上插到是放到head里面,可是这个没有head

而且、这个body怎么没有开始标签。。。
发表于 2018-1-30 11:57:43 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 2018-1-30 11:58:55 | 显示全部楼层

好的,谢谢。
全部加进去,包括script标签吗。
 楼主| 发表于 2018-1-30 11:59:58 | 显示全部楼层

可以了。谢谢
发表于 2018-1-30 12:02:11 | 显示全部楼层
qwer 发表于 2018-1-30 11:57
随便放吗。~~我在网上插到是放到head里面,可是这个没有head

而且、这个body怎么没有开始标签。。。 ...

head标签应该在header.php里面吧…………
 楼主| 发表于 2018-1-30 12:03:21 | 显示全部楼层
shc 发表于 2018-1-30 12:02
head标签应该在header.php里面吧…………

我以为每个页面都能有head呢~不太懂php,谢谢回复。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|FastFib VPS论坛

GMT+8, 2024-9-22 07:23 , Processed in 0.060466 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表