简体   繁体   中英

HTML5 wordpress theme on WebKit goes crazy?

I was testing WP HTML5 theme, when I spotted this bug. The whole content lowered by about 19px, and when I turned on source code, code which I placed between head tags in editor are between body tags in chrome source code. This is showing just on Webkit browsers (Chrome and Opera), while on Firefox it is fine.

I tried to fix this bug with:

-webkit-margin-before: -16px;

but this is not working for page template in WP theme, because there is no bug when I run any Wordpress page sample on Chrome. I tried to copy code from page template (page.php) to article template (single.php), and know they are running on same code but there is difference in appearance (look at screenshot).

screenshot

Code of a both templates (page.html and 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时,问题就消失了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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