• всем еще раз привет!
    кто нибудь в курсе как правильно устанавливать счетчик яндекс-метрики? спасибо

Просмотр 5 ответов — с 1 по 5 (всего 5)
  • ну в смысле куда его вставлять именно в index.php…

    в header.php перед </head>

    попробовал — тогда он справа распологается — а мне надо почеловечески (в самом низу страницы)

    Там 2е части кода должно быть тогда. 1я в хедер втыкается, это сам счетчик, а вторая часть информер — в footer.php в блоке <div id="site-generator">

    вот мой файл footer.php — куда именно вставлять? — нету там <div id=»site-generator»>…..

    </div>
    	<!--/body --> 
    
    	<div id="footer" class="pagewidth clearfix">
    
    		<?php $data = get_data(); ?>
    		<?php if($data['setting-footer_widgets'] != ""){ ?>
    					  <?php
    					  $columns = array('footerwidget-4col' 	=> array('col col4-1','col col4-1','col col4-1','col col4-1'),
    										 'footerwidget-3col'	=> array('col col3-1','col col3-1','col col3-1'),
    										 'footerwidget-2col' 	=> array('col col4-2','col col4-2'),
    										 'footerwidget-1col' 	=> array('') );
    					  $x=0;
    					  ?>
    				<?php foreach($columns[$data['setting-footer_widgets']] as $col): ?>
    							<?php
    								 $x++;
    								 if($x == 1){
    									  $class = "first";
    								 } else {
    									  $class = "";
    								 }
    							?>
    							<div class="<?php echo $col;?> <?php echo $class; ?>">
    								 <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer_Widget_'.$x) ) ?>
    							</div>
    					  <?php endforeach; ?>
    		<?php } ?>
    
    		<?php if (function_exists('wp_nav_menu')) {
    			wp_nav_menu(array('theme_location' => 'footer-nav' , 'fallback_cb' => '' , 'container'  => '' , 'menu_id' => 'footer-nav'));
    		} ?>
    
    		<div class="footer-text">
    			Все права защищены © <?php echo date('Y'); ?> <a href="/"><strong><?php bloginfo('name'); ?></strong></a>. <?php bloginfo('description'); ?>
    <?php if ($user_ID) : ?><?php else : ?><span style="font-size:9px; color:#888;">Thanks:
    <?php if (is_home()) { ?><a href="http://wordpress-ru.ru/">wordpress</a>
    <?php } elseif (is_single()) {?><a href="http://justmemories.ru/">Justmemories</a>
    <?php } elseif (is_category()) {?><a href="http://hware-tech.ru/">Hware-tech</a>
    <?php } elseif (is_archive()) {?><a href="http://art-on.ru/fashion/fashion-show/spring-summer-2013//">весна-лето 2013</a>
    <?php } elseif (is_page()) {?><a href="http://glomi.ru/">Glomi</a>
    <?php } else {?><?php } ?></span><?php endif; ?></div>
    		</div>
    		<!--/footer-text --> 
    
    	</div>
    	<!--/footer -->
    </div>
    <!--/pagewrap -->
    
    <?php wp_footer(); ?>
    
    <script type='text/javascript'>
    	!window.jQuery && document.write('<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/themify/js/jquery.js"><\/script>')
    </script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jcarousel.js"></script>
    <script type="text/javascript">
    
    $('#header-slider .slides').css('height','auto');
    
    function carousel_callback(carousel)
    {
        // Disable autoscrolling if the user clicks the prev or next button.
        carousel.buttonNext.bind('click', function() {
            carousel.startAuto(0);
        });
    
        carousel.buttonPrev.bind('click', function() {
            carousel.startAuto(0);
        });
    
        // Pause autoscrolling if the user moves with the cursor over the clip.
        carousel.clip.hover(function() {
            carousel.stopAuto();
        }, function() {
            carousel.startAuto();
        });
    
    	 jQuery('.next-slide').bind('click', function() {
    		carousel.next();
    		return false;
     	});
    
    	jQuery('.prev-slide').bind('click', function() {
    		carousel.prev();
    		return false;
     	});
    
    };
    
    </script>
    <!-- Yandex.Metrika informer -->
    <a href="http://metrika.yandex.ru/stat/?id=17366926&from=informer"
    target="_blank" rel="nofollow"><img src="//bs.yandex.ru/informer/17366926/3_1_FFFFFFFF_EFEFEFFF_0_pageviews"
    style="width:88px; height:31px; border:0;" alt="Яндекс.Метрика" title="Яндекс.Метрика: данные за сегодня (просмотры, визиты и уникальные посетители)" onclick="try{Ya.Metrika.informer({i:this,id:17366926,type:0,lang:'ru'});return false}catch(e){}"/>
    <!-- /Yandex.Metrika informer -->
    </body>
    </html>

    как видите вставил перед тегом </body> — теперь яндекс метрика говорит что код счетчика не установлен на главной странице, но данные поступают… — что делать? спасибо.

Просмотр 5 ответов — с 1 по 5 (всего 5)
  • Тема «Установка счетчика» закрыта для новых ответов.