qwer 发表于 2018-1-30 11:55:13

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

本帖最后由 qwer 于 2018-1-30 12:01 编辑

This footer.php
<?php
/**
* The template for displaying footer
*
* @since 1.0.0
* @package Coolbox
*/

if ( cd_is_amp() ) :
        cd_addon_amp_footer();
else :
?>

<footer id="footer" class="footer">

        <?php cd_footer_menu(); ?>

        <div class="footer-bottom">

                <div class="container">

                        <div class="copyright">

                                <p>
                                        <?php
                                        $allowed_html = array(
                                                'a'      => array(
                                                        'href'    => array(),
                                                        'onclick' => array(),
                                                        'target'=> array(),
                                                ),
                                                'p'      => array(
                                                        'style'=> array(),
                                                        'align'=> array(),
                                                        'target' => array(),
                                                ),
                                                'br'   => array(),
                                                'strong' => array(),
                                                'b'      => array(),
                                                'small'=> array(),
                                        );
                                        ?>

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

                                <?php if ( cd_is_theme_credit() ) : ?>
                                        <p>
                                                <?php echo wp_kses( cd_theme_credit_text(), $allowed_html ); ?>
                                        </p>
                                <?php endif; ?>

                        </div>

                        <?php cd_social_links(); ?>

                </div>

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

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

</footer>

<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>


<?php wp_footer(); ?>
</body></html>

<?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");
s.parentNode.insertBefore(hm, s);
})();
</script>

南琴浪 发表于 2018-1-30 11:56:12

随便找个位置放进去啊。

dvbhack 发表于 2018-1-30 11:56:50

</body></html> 前面

qwer 发表于 2018-1-30 11:57:34

南琴浪 发表于 2018-1-30 11:56
随便找个位置放进去啊。

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

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

ddnpc 发表于 2018-1-30 11:57:43

qwer 发表于 2018-1-30 11:58:55

dvbhack 发表于 2018-1-30 11:56
前面

好的,谢谢。
全部加进去,包括script标签吗。

qwer 发表于 2018-1-30 11:59:58

ddnpc 发表于 2018-1-30 11:57
wp_footer() 后面

可以了。谢谢

shc 发表于 2018-1-30 12:02:11

qwer 发表于 2018-1-30 11:57
随便放吗。~~我在网上插到是放到head里面,可是这个没有head

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

head标签应该在header.php里面吧…………

qwer 发表于 2018-1-30 12:03:21

shc 发表于 2018-1-30 12:02
head标签应该在header.php里面吧…………

我以为每个页面都能有head呢~不太懂php,谢谢回复。
页: [1]
查看完整版本: 【已解决】统计代码应该加到哪个位置?