2012-01-21 4 views
0

내가 광고에 대해 여러 플러그인을 시도하고 각 페이지 새로 고침을 위해 모두 3로 계산 : (랜덤 #이 전망 및 브라우저는 사람에 따라 업데이트) 여러 플러그인 3 광고 노출로 모든 페이지 새로 고침 카운트 노출 수.워드 프레스 광고 :)

왜 이런 일이 발생했는지 또는 어떻게 수정해야하는지 알기 원하십니까?

현재 광고 엔진 플러그인을 사용하여, 이미 간단한 광고 관리자를 시도했다. 이미지 사용.

예제 코드 :

    <!doctype html> 
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> 
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> 
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> 
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> 
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline --> 
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> 
<head> 
    <meta charset="utf-8"> 

    <!-- Use the .htaccess and remove these lines to avoid edge case issues. 
     More info: h5bp.com/b/378 --> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 

    <!--Wordpress Template--> 
    <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title> 
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> 

    <?php wp_head(); ?> 

    <meta name="description" content="Saint Petersburg SociaBulls"> 
    <meta name="author" content="Austin Piazza"> 

    <!-- Mobile viewport optimized: j.mp/bplateviewport --> 
    <meta name="viewport" content="width=device-width,initial-scale=1"> 

    <!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons --> 

    <link rel="stylesheet" type="text/css" href="<?php bloginfo('wpurl'); ?>/wp-content/themes/sociabulls/js/jcar/skins/tango/skin.css" /> 

    <!-- CSS: implied media=all --> 
    <!-- CSS concatenated and minified via ant build script--> 
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen,projection" /> 
    <!-- end CSS--> 

    <!-- More ideas for your <head> here: h5bp.com/d/head-Tips --> 

    <!-- All JavaScript at the bottom, except for Modernizr/Respond. 
     Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries 
     For optimal performance, use a custom Modernizr build: www.modernizr.com/download/ --> 
    <script src="<?php bloginfo('wpurl'); ?>/wp-content/themes/sociabulls/js/libs/modernizr-2.0.6.min.js"></script> 


    <!-- end scripts--> 

    <script type="text/javascript"> 
jQuery(document).ready(function() { 
    jQuery('#mycarousel').jcarousel({ 
     // Configuration goes here 
    }); 
}); 
</script> 

    <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'> 
</head> 

<body <?php body_class($class); ?>> 

    <div class="wide" id="container"> 
    <header id="sticky" class="wide"> 
     <div class="center"> 
     <a href="#"><h1 id="logo" class="notext">St. Pete Sociabulls</h1></a> 
     <ul id="nav"> 
      <?php wp_list_pages('title_li='); ?> 
     </ul> 
     </div> 
    </header> 

<div id="page"> 
<div id="top"><div id="city"></div></div> 
<div id="main" role="main" class="wide"> 
    <div id="full"> 
     <div class="center"> 
      <div id="moveup"> 

       <div id="main-event"> 
        <h2><?php the_title('');?></h2> 
        <?php if (have_posts()) : while (have_posts()) : the_post();?> 
        <div class="whole-post"> 

         <div class="post-date"> 
          <?php the_date('M d'); ?> 
         </div> 
         <div class="entry"> 
          <div class="entrytext"> 
            <?php the_content(); ?> 
          </div> 
         </div> 
        </div> 
        <?php endwhile; endif; ?> 
       </div> 

       <aside> 

        <?php if (!function_exists('dynamic_sidebar') 
     || !dynamic_sidebar('rightsidebar')) : ?> 
<?php endif; ?> 

<div id="ad-box"> 
        <?php if (!function_exists('dynamic_sidebar') 
     || !dynamic_sidebar('Ads')) : ?> 
<?php endif; ?> 
</div> 

       </aside> 

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


<footer class="wide"> 
     <div id="seawall"> 
      <div class="center"> 
       <div id="sponsors"> 
        <?php if (!function_exists('dynamic_sidebar') 
     || !dynamic_sidebar('extra')) : ?> 
<p>This is the deafult sidebar, add some widgets to change it.</p> 
<?php endif; ?> 

       </div> 
       <div id="social-page"> 
        <div class="fb-like-box" data-href="http://www.facebook.com/swingstampabay" data-width="350" data-height="170" data-show-faces="true" data-stream="false" data-header="false"></div> 
       </div> 
      </div> 
     </div> 
    </footer> 
    </div> <!--! end of #container --> 


    <!-- JavaScript at the bottom for fast page loading --> 

    <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline --> 
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> 
    <script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.2.min.js"><\/script>')</script> 
    <script type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-content/themes/sociabulls/js/jcar/lib/jquery.jcarousel.js"></script> 

    <!-- scripts concatenated and minified via ant build script--> 
    <script defer src="js/plugins.js"></script> 
    <script defer src="js/script.js"></script> 

    <div id="fb-root"></div> 
<script>(function(d, s, id) { 
    var js, fjs = d.getElementsByTagName(s)[0]; 
    if (d.getElementById(id)) return; 
    js = d.createElement(s); js.id = id; 
    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=270668269621466"; 
    fjs.parentNode.insertBefore(js, fjs); 
}(document, 'script', 'facebook-jssdk'));</script> 

<div id="fb-root"></div> 
<script>(function(d, s, id) { 
    var js, fjs = d.getElementsByTagName(s)[0]; 
    if (d.getElementById(id)) return; 
    js = d.createElement(s); js.id = id; 
    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=265187160174054"; 
    fjs.parentNode.insertBefore(js, fjs); 
}(document, 'script', 'facebook-jssdk'));</script> 


    <!-- Change UA-XXXXX-X to be your site's ID --> 
    <script> 
    window._gaq = [['_setAccount','UAXXXXXXXX1'],['_trackPageview'],['_trackPageLoadTime']]; 
    Modernizr.load({ 
     load: ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js' 
    }); 
    </script> 


    <!-- Prompt IE 6 users to install Chrome Frame. Remove this if you want to support IE 6. 
     chromium.org/developers/how-tos/chrome-frame-getting-started --> 
    <!--[if lt IE 7 ]> 
    <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script> 
    <script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script> 
    <![endif]--> 

    <?php wp_footer(); ?> 

</body> 
</html> 

플러그인 코드 : https://gist.github.com/1654868

업데이트 : 추가 내 모든 코드를 함께

감사합니다!

답변

0

아무렇지도 않은 말은 전혀 없습니다!

나는이 모든 문제는 ... 내 위젯 영역 '광고'를 이름에서였다

0

한 가지 확인 사항 :

다른 테마와 함께

을 어떻게합니까? 그렇지 않은 경우, 플러그인의 카운터는 어떤 API 후크에 걸려 있습니까?

기회는 템플릿/테마가 아닌 표준 패턴을 다음과 주어진 창녀 페이지로드 당 한 번 이상 활성화 될 일으키는 것이 있습니다. 문제가 테마에 의해 트리거되는 경우

, 우리는 디버깅 까다로운 상황에 있습니다. 플러그인 소스 코드가 너무 크지 않으면

:

http://codex.wordpress.org/Plugin_API/Action_Reference

어떤 접근 방법 : 플러그인 API 후크가 조금 많다과 테마의 많은 지역에서 발사 할 수있다,이 참조를 살펴 , 이벤트의 반복이 어디에서 일어나고 있는지 파악할 수있는 것보다 그것을보고 걸이의 사용을 찾아 볼 수 있습니다.

는 기능 테마로 테마를 비교하고 당신이 어떤 안티 패턴을 수행하는 경우를 참조하십시오. 머리글 부분, 사이드 바 및 바닥 글을 시작할 것입니다. 반복 횟수 (3)도 좋은 팁이 될 수 있습니다.

테마에서 주어진 코드 조각을 3 번 반복하고 있습니까? 포스트 루프가 정확히 3 번 실행됩니까?

는 이론적으로 문제 코드가 어디 수 있지만 기능 테마의 헤더와 헤더를 비교하는 몇 가지주의를 줄 수있는,이 테마의 가장 중요한 부분 중 하나입니다.

+0

이 무슨 뜻 이죠 믿을 수 없어? "케이스가 아니라, 어떤 고리가 카운터에 걸려 있습니까?" 상태 : 다른 템플릿을 확인 중입니다. – Reuben

+0

좋아요. 내 테마가 다른 것에서 훌륭하게 작동합니다. 무엇이 될 수 있습니까? – Reuben

+0

그냥 내 코드를 붙여 넣었습니다. 어떤 도움을 주셔서 감사합니다 :) – Reuben