google adsense广告未显示在home-track.html上

时间:2018-01-20 23:28:26

标签: php html ads adsense

我有index.php主页:

<!doctype html>

<html>    
<head>

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-123456789123456",
    enable_page_level_ads: true
  });
</script>

 <?php require_once "system/configs.php"; ?>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="<?= $baseurl?>css/bootstrap.css">
    <link rel="stylesheet" href="<?= $baseurl?>css/font-awesome.css">
    <meta name="google-signin-client_id" content="80957862538-juiu2cgia32rn3lik36fv9a1ihc6fqof.apps.googleusercontent.com">
    <link rel="stylesheet" href="<?= $baseurl?>css/animate.css">
    <link rel="stylesheet" href="<?= $baseurl?>css/style.css">
    <link rel="stylesheet" href="<?= $baseurl?>css/player.css">

    <title>Radio Shqip</title>
    <base href="/">
</head>
<body ng-app="musiclistener">
    <span ng-cloak>
        <span ng-view ></span>
    </span>


    <div id='player-container'>
        <audio controls id='music-player' src="#"></audio>

        <div class='container-fluid'>
            <div class='col-sm-1 col-xs-3 text-center' id='play-icon-container'>
                <i class='fa fa-play-circle' id='play-btn'  ng-click="playtoogle()"></i>
            </div>
            <div class='col-sm-1 center-block hidden-xs' id='podcast-icon-container'>
                <img src="{{ playerthumb }}"  id='play-img' class='img-responsive center-block' style="margin-top:7.5px">
            </div>
            <div class='col-md-6 col-sm-4 col-xs-6' id='podcast-bar-container' style="margin-top:17px">
                <span style='color:#fff;position:relative;top:3px;text-transform:capitalize' ng-if="musicplayingentity">{{ musicplayingentity}}</span>
                <div id='podcast-progress'>
                    <div id='podcast-id-value'></div>
                </div>
            </div>
            <div class='col-md-1 col-sm-2 text-center hidden-xs' id='addons-icon-container'>

                <span ng-hide="userLoggedIn">
                    <a href data-toggle="modal" data-target="#loginModal"><i class='fa fa-heart-o pull-left'></i></a>           
                    <a href data-toggle="modal" data-target="#loginModal"><i class='fa fa-comment-o '></i></a>
                </span>

                <span ng-show ="userLoggedIn">
                    <i ng-click="makeFavoritePlayer()" ng-hide="playingfav" class='fa fa-heart-o extrafun'></i>
                    <i ng-click="removeFavoritePlayer()" ng-show="playingfav" class='fa fa-check extrafun'></i>
                    <i ng-click="showCommentBoxPlayer()" class='fa fa-comment-o'></i>
                </span>

                <i class='fa fa-share-alt pull-right' ng-click="shareboxPlayer(shareslug)"></i>
            </div>
            <div class='col-sm-3 col-xs-3 text-center' id='volume-container'>
                    <div class='col-xs-2'>
                        <i class='fa fa-volume-up'></i>                     
                    </div>
                    <div class='col-xs-1 col-md-9' style="margin-top:20px">
                        <div id='volume-progress'>
                            <div id='volume-id-value'></div>
                        </div>
                    </div>
            </div>
        </div>
    </div>


    <script src="https://apis.google.com/js/platform.js" async defer></script>  
    <script src="<?= $baseurl?>ang/angular.min.js"></script>
    <script src="<?= $baseurl?>ang/angular-sanitize.min.js"></script>
    <script src="<?= $baseurl?>ang/angular-route.min.js"></script>
    <script src="<?= $baseurl?>ang/angular-cookies.min.js"></script>
    <script src="<?= $baseurl?>ang/angular-facebook-sdk.js"></script>
    <script>
      window.fbAsyncInit = function() 
      {
            FB.init({ appId      : '195962897544265',  xfbml : true,  version : 'v2.8'  });
      };
    </script>



    <script src="<?= $baseurl?>ang/app.js"></script>
    <script src="<?= $baseurl?>ang/controllers.js"></script>
    <script src='<?= $baseurl?>js/jquery-1.7.2.min.js'></script>
    <script src='<?= $baseurl?>js/bootstrap.js'></script>
    <script src='<?= $baseurl?>js/typed.js'></script>
    <script src='<?= $baseurl?>js/wow.js'></script>
    <script src='<?= $baseurl?>js/player.js'></script>
    <script type="text/javascript" src="<?= $baseurl?>js/script.js"></script>
    <script type="text/javascript" src="<?= $baseurl?>ang/core.js"></script>
    <script>
      new WOW().init();
    </script>
    <script>
      $(function(){
          $(".typing-text").typed({
            strings: ["MUSIC", "SPORTS", "BOOKS", "NEWS", "TALK"],
            typeSpeed: 200,
            backSpeed: 150,
            loop: true
          });
      });
    </script>
</body>
</html>

和home-track.html在模板文件夹中我要添加我的Adsense广告单元代码并显示在那里:

<section id="device" class="ng-scope" ng-controller="recentStation">

<div class="info_section_inner">
<div class="info_section_col" style="float: center;">
<p>
AAAA
</p>
                 </div>
    <div class="container wow fadeIn" style="visibility: visible; animation-name: fadeIn;">

           <div class="list_stations medium">
               <div class="list_header clearfix">
                   <div class="stations-heading-h2 ng-binding" style="margin-bottom:25px; padding-top:25px; color:#000000;" ><p style="font-family:calibri; font-size:45px;">
                   Recent stations
                   </div>

               </div>



          <div class="list_body">



<div style="float: right; margin: 10px 0px 10px 10px;">
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Shqipradio2 -->
<ins class="adsbygoogle hidead"
     style="display:inline-block;width:300px;height:600px"
     data-ad-client="ca-pub-123456789123456"
     data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
    </div>

                    <!-- ngRepeat: chn in channels --><div class="list_item ng-scope" ng-repeat="chn in channels">
                        <div class="bg"> 
                            <a class="image_outer" href="channel/{{chn.slug}}"> <span class="image"><img ng-src="{{chn.channel_image}}" alt="tea cup match" style="overflow:hidden;" width="100%" height="100%" itemprop="image" src="{{chn.channel_image}}" class="hoverZoomLink"></span> 
                                <span class="overlay">
                                 <!--  -->
                                </span> 
                                <span class="country ng-binding"></span> 
                            </a> 
                            <div class="name" itemprop="name" >
                                <a href="channel/{{chn.slug}}" class="ng-binding" style="color:#000000;">{{chn.channel_name}}</a>
                            </div>

                        </div>
                   </div>
              </div>



              <div class="list_footer clearfix"> 
                   <a href="location" title="" class="button button_dark right ng-binding">All stations</a> 
<br>

              </div>
          </div>    
</div></section>

因此,当我在index.php中粘贴广告单元代码时,一切都很好,但广告会在标题之前或页脚之后显示,所以我想在home-track.html中实现并在此处显示我想要的内容。当我将代码粘贴到home-track.html时,广告空间就像我的身高和体重,但广告没有显示。

PS。我不想从adsense实施quickads,只是为了粘贴我的广告单元代码。 我已经在index.php中粘贴了我的快速广告代码,但我会从那里删除。 感谢

1 个答案:

答案 0 :(得分:0)

当我粘贴此代码时:

<style>
@media (max-width: 480px) {
.hidead {
display: none !important;
}
}
</style>
<div style="float: right; margin: 10px 0px 10px 10px;">
<iframe width="300" height="600" frameborder="0" class="adsbygoogle hidead"
src="https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-        
123456789123456&amp;output=html&amp;h=600&amp;slotname=1234567890&amp">
</iframe>
</div>

广告在我想要的地方一切都很好。但是为什么当我粘贴google给我的代码doestn show:

<style>
@media (max-width: 480px) {
.hidead {
display: none !important;
}
}
</style>
<div style="float: right; margin: 10px 0px 10px 10px;">
<script async         
src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Shqipradio2 -->
<ins class="adsbygoogle hidead"
style="display:inline-block;width:300px;height:600px"
data-ad-client="ca-pub-123456789123456"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>

使用此代码时出错了