Просмотр 7 ответов — с 1 по 7 (всего 7)
  • Ах, да! Моя page теперь стала такой:

    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    
    get_header(); ?>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', 'page' ); ?>
    				<?php comments_template( '', true ); ?>
    			<?php endwhile; // end of the loop. ?>
    
    		</div><!-- #content -->
    	<!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    <body><!-- Yandex.Metrika informer -->
    <a href="http://metrika.yandex.ru/stat/?id=22154318&from=informer"
    target="_blank" rel="nofollow"><img src="//bs.yandex.ru/informer/22154318/1_0_FFFFFFFF_FFFFFFFF_0_pageviews"
    style="width:80px; height:15px; border:0;" alt="Яндекс.Метрика" title="Яндекс.Метрика: данные за сегодня (просмотры)" />
    <!-- /Yandex.Metrika informer -->
    
    <!-- Yandex.Metrika counter -->
    <script type="text/javascript">
    (function (d, w, c) {
        (w[c] = w[c] || []).push(function() {
            try {
                w.yaCounter22154318 = new Ya.Metrika({id:22154318,
                        clickmap:true,
                        trackLinks:true,
                        accurateTrackBounce:true});
            } catch(e) { }
        });
    
        var n = d.getElementsByTagName("script")[0],
            s = d.createElement("script"),
            f = function () { n.parentNode.insertBefore(s, n); };
        s.type = "text/javascript";
        s.async = true;
        s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
    
        if (w.opera == "[object Opera]") {
            d.addEventListener("DOMContentLoaded", f, false);
        } else { f(); }
    })(document, window, "yandex_metrika_callbacks");
    </script>
    <noscript><div><img src="//mc.yandex.ru/watch/22154318" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
    <!-- /Yandex.Metrika counter --></body>

    Модератор Sergey Biryukov

    (@sergeybiryukov)

    Live and Learn

    У вас тема Twenty Twelve 1.1. Стандартный файл page.php в ней выглядит так:
    https://themes.trac.wordpress.org/browser/twentytwelve/1.1/page.php

    Модератор Sergey Biryukov

    (@sergeybiryukov)

    Live and Learn

    Не хватает закрывающего тега </div> перед <!-- #primary -->.

    Кроме того, код Яндекс.Метрики вставлен некорректно — после тега </html> (который у вас в footer.php) уже ничего не должно быть.

    Йееееееееессссс!!!!!!! :)))))) Ура! Всё встало на место! Спасибо Вам огромное — я уже второй раз файлы начала сравнивать — не нашла сама!

    Вот так — правильно?

    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    
    get_header(); ?>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', 'page' ); ?>
    				<?php comments_template( '', true ); ?>
    			<?php endwhile; // end of the loop. ?>
    
    		</div><!-- #content -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <body><!-- Yandex.Metrika informer -->
    <a href="http://metrika.yandex.ru/stat/?id=22154318&from=informer"
    target="_blank" rel="nofollow"><img src="//bs.yandex.ru/informer/22154318/1_0_FFFFFFFF_FFFFFFFF_0_pageviews"
    style="width:80px; height:15px; border:0;" alt="Яндекс.Метрика" title="Яндекс.Метрика: данные за сегодня (просмотры)" />
    <!-- /Yandex.Metrika informer -->
    
    <!-- Yandex.Metrika counter -->
    <script type="text/javascript">
    (function (d, w, c) {
        (w[c] = w[c] || []).push(function() {
            try {
                w.yaCounter22154318 = new Ya.Metrika({id:22154318,
                        clickmap:true,
                        trackLinks:true,
                        accurateTrackBounce:true});
            } catch(e) { }
        });
    
        var n = d.getElementsByTagName("script")[0],
            s = d.createElement("script"),
            f = function () { n.parentNode.insertBefore(s, n); };
        s.type = "text/javascript";
        s.async = true;
        s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
    
        if (w.opera == "[object Opera]") {
            d.addEventListener("DOMContentLoaded", f, false);
        } else { f(); }
    })(document, window, "yandex_metrika_callbacks");
    </script>
    <noscript><div><img src="//mc.yandex.ru/watch/22154318" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
    <!-- /Yandex.Metrika counter --></body>
    <?php get_footer(); ?>
    Модератор Sergey Biryukov

    (@sergeybiryukov)

    Live and Learn

    Так лучше, но теги <body>...</body> здесь не нужны.

    Тег <body> открывается в header.php и закрывается в footer.php, на странице он должен быть только в одном экземпляре.

    О, прогресс. Поняла, что header имеет логическую связь с footer`ом ) А я думала они там просто, как бисер насыпаны )

Просмотр 7 ответов — с 1 по 7 (всего 7)
  • Тема «Как восстановить page.php?» закрыта для новых ответов.