Wordpress如何检测纯文本内容


How does Wordpress detect text-only content?

我下面粘贴的代码来自twentyelleven主题的header.php。我只是想知道该查找哪个函数来检测纯文本内容?

<nav id="access" role="navigation">
<h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
<?php /* Allow screen readers / text browsers to skip the navigation menu 
         and get right to the good stuff. */ ?>
<div class="skip-link">
  <a class="assistive-text" href="#content" 
     title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>">
    <?php _e( 'Skip to primary content', 'twentyeleven' ); ?>
  </a>
</div>
<div class="skip-link">
  <a class="assistive-text" href="#secondary" 
     title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>">
      <?php _e( 'Skip to secondary content', 'twentyeleven' ); ?>
    </a>
</div>
<?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back 
      to wp_page_menu. The menu assigned to the primary location is the one used. 
      If one isn't assigned, the menu with the lowest ID is used. */ ?>
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</nav><!-- #access -->

我问这个问题的原因是,我正在用我正在开发的主题测试这个代码,尽管页面上有图像等,但它的行为就像我的主题只是文本一样。此外,它是Windows上的Firefox,所以很明显浏览器是可以的(也在Chrome中检查过)。所以基本上,我试图弄清楚让它看起来像是"纯文本"的标准,或者这个代码是如何执行的
我也查看了各种.js文件,但没有看到任何内容。这似乎是用PHP完成的。

我不得不同意安德里亚斯的观点。当东西看起来还是1991年的时候,我第一个开始的地方是css。你所有的样式表都正确链接了吗?Wordpress在处理样式表和脚本链接时可能会变得棘手,因为有太多php调用在进行

您可以尝试编辑头文件以包含这部分PHP。然后是博客模板目录根目录中的任何文件地址。

<?php bloginfo('template_directory'); ?>

我唯一能想到的另一件事是,由于某种原因,当你的网站看起来像是通过屏幕阅读器查看网站时,它会出错,这会迫使它只显示文本。你可以试着删除那部分代码,看看这是否有效。但这仍然表明你的主题的这一部分有问题。

听起来更像是你弄错了一些图片的URL?

您可能会在Wordpress answers上获得更多答案。