验证HTML错误

时间:2015-09-17 13:55:52

标签: php html

我试图解决HTML错误,但不知道怎么做。错误是:

  

"元素' a'在此上下文中不允许作为子元素。"

源代码是:

<div class="navigation-previous-blog bd_headings_text_shadow zero_color fade_anchor"> 
<a href="http://www.acessibilidadeweb.pt/?pirenko_team_member=frederico-branco" alt="Frederico Branco" rel="next" data-pir_title="Frederico Branco"> <div class="icon-left-bold"></div>

PHP代码是:

<div class="navigation-previous-blog bd_headings_text_shadow zero_color fade_anchor"> 
    <?php 
        next_post_link_plus( array(
            'in_same_cat' => true,
            'format' => '%link',
            'link' => ' <div class="icon-left-bold"></div><div class="after_icon_blog"><h5 class="header_font">%title</h5></div>'
        ) );
    ?>
</div>

1 个答案:

答案 0 :(得分:1)

我怀疑你可能会落后。请尝试以下方法:

<div class="navigation-previous-blog bd_headings_text_shadow zero_color fade_anchor"> 
    <?php 
        next_post_link_plus( array(
            'in_same_cat' => true,
            'format' => ' <div class="icon-left-bold"></div><div class="after_icon_blog"><h5 class="header_font">%link</h5></div>',
            'link' => '%title'
        ) );
    ?>
</div>

http://www.ambrosite.com/plugins/next-previous-post-link-plus-for-wordpress,他们给出以下示例:

<?php
next_post_link_plus( array(
    'link' => '%title',
    'format' => '%link (posted in %category on %date by %author)'
) );
?>