繁体   English   中英

WebKit上的HTML5 wordpress主题发疯了吗?

[英]HTML5 wordpress theme on WebKit goes crazy?

当我发现此错误时,我正在测试WP HTML5主题。 整个内容降低了大约19像素,当我打开源代码时,放置在编辑器中head标签之间的代码在chrome源代码中的body标签之间。 这仅在Webkit浏览器(Chrome和Opera)上显示,而在Firefox上很好。

我尝试使用以下方法修复此错误:

-webkit-margin-before: -16px;

但这不适用于WP主题中的页面模板,因为在Chrome上运行任何Wordpress页面示例时都没有错误。 我试图将代码从页面模板(page.php)复制到文章模板(single.php),并且知道它们在相同的代码上运行,但是外观有所不同(请看屏幕截图)。

屏幕截图

两种模板的代码(page.html和single.html):

<?php

  get_header();

  if (have_posts()): 
    while (have_posts()) : the_post(); ?>

    <article class="postWrapper" id="post-<?php the_ID(); ?>">
            <div class="thumb">
                <?php 
                  the_post_thumbnail();
                ?>
            </div>
            <div class="post-text">
                <p class="category">
                    <?php the_category(' &#187; '); ?>
                </p>
                <h2 class="article-title postTitle">
                    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_excerpt(); ?>">

                            <?php the_title(); ?>

                    </a>
                </h2>
                <p class="details">
                    <?php the_date(); ?> Autor: <strong><?php the_author_link(); ?></strong>, <?php comments_popup_link(__('Nema komentara'), __('1 komentar'), __('% komentara')) . edit_post_link(__('Izmeni'), ' | '); ?>
                </p>
                <div class="text">
                    <?php the_content(__('Pročitaj više...')); ?>
                </div>
            </div>

    </article>



    <?php endwhile; else: ?>

  <p><?php _e('Žao nam je, nismo ništa pronašli što vas interesuje. :('); ?></p>

<?php

  endif;
  ?>
</div>

<?php
    get_sidebar();  ?>
    </div>
<?php

    get_footer();
?>

问题是关于在Notepad ++中进行编码,我使用了UTF-8,但是当我打开没有BOM的UTF-8时,问题就消失了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM