2013-08-07 45 views
0

此处http://smallbusinessauthority.com.au/blog/,发布日期旁边的作者meta的href显示为“[]”。代码是使用页脚html标记,如果我删除了页脚标记,那么它工作正常。在wordpress中显示标签href的html页脚标签不会在[]和侧边栏中单独显示

<footer class="entry-meta"> 
         <span class="by-author">By <span class="author vcard"><a class="url fn n" href="http://smallbusinessauthority.com.au/author/admin/" title="View all posts by admin" rel="author">admin</a></span></span> on <a href="http://smallbusinessauthority.com.au/objectives-management-the-key-to-success-for-the-largest-to-the-smallest-businesses-and-what-the-solution-providers-dont-tell-you/" title="8:59 am" rel="bookmark"><time class="entry-date" datetime="2013-07-29T08:59:20+00:00">July 29, 2013</time></a>.     </footer> 

即使在此博客页面上不显示侧边栏。每个设置对于侧边栏都是正确的,甚至在文件中正确显示。

代码模板文件: “的风格=” 保证金左:30PX; “> ” 称号= “” 相对= “书签”>

<footer class="entry-meta"> 
     <?php if (is_single()) : ?> 
      <?php //twentytwelve_entry_meta(); ?> 
     <?php else : ?> 
      <?php twentytwelve_entry_meta(); ?> 
     <?php endif; ?> 
    </footer><!-- .entry-meta --> 
    </header><!-- .entry-header --> 

    <?php if (is_search()) : // Only display Excerpts for Search ?> 
    <div class="entry-summary"> 
     <?php the_excerpt(); ?> 
    </div><!-- .entry-summary --> 
    <?php elseif (is_single()) : ?> 
    <div class="entry-content" style="padding-bottom:20px; padding-top:0px;"> 
     <?php the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve')); ?> 
    </div> 
    <?php else : ?> 
    <div class="entry-content" style="padding-bottom:20px; padding-top:0px;"> 
     <?php echo substr(get_the_content(), 0 , 300). "...."; //the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve')); ?> 
     <a href="<?php echo the_permalink(); ?>">Read More</a> 
    </div><!-- .entry-content --> 
    <?php endif; ?> 
</article><!-- #post --> 
+0

发布完整页面的代码,以便我们可以看到您正在使用的模板标签。 – wunderdojo

+0

我把问题的代码 –

+0

你在回应the_permalink() - 该函数已经打印出链接。如果您使用get_the_permalink(),则只需要回显它。 http://codex.wordpress.org/Function_Reference/the_permalink – wunderdojo

回答

0

您所描述的问题是由于这些行的c在你的CSS代码:

footer a[rel=bookmark]:link:after, 
footer a[rel=bookmark]:visited:after { 
    content: " [" attr(href) "] "; /* Show URLs */ 
} 

http://smallbusinessauthority.com.au/wp-content/themes/SBA/style.css?ver=3.5.1)。

它们将[]放在页脚的周围。 你可以在你自己的CSS类中覆盖它,或者如果可以的话删除它。 基本上将href属性包含在[]中,并将其作为链接的内容。

有关更多说明,请参阅http://www.quirksmode.org/css/content.html

+0

忘记了关于语气的东西,侧边栏也没有到来 –

+0

是什么问题你是什么意思吧?它说:'就业 管理 营销 - 内容营销 生产力? – putvande

+0

正确的看法是像http://screencast.com/t/DnlIIDEt但不知道它如何得到影响 –