0

我为 Wordpress 编写了一个简单的短代码,它根据特定的内容搜索输出一组内部的另一个。

问题是,我不断收到这个

我的输出中的标签,这使我的代码有点混乱。虽然我可以忍受它,但我不能快乐地生活。

我已经添加了

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

在我的主题的“functions.php”中。但结果是一样的。

简码代码如下:

$return = "<div class='tarimas-teaser-container'>";
$n = 0;
if ($wp_qry->have_posts()):
    while ($wp_qry->have_posts()): $wp_qry->the_post();
        $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($wp_qry->post->ID), 'thumbnail');
        $return .= "<div class='tarimas-teaser-unit'><h4><a href='{$wp_qry->post->guid}'>{$wp_qry->post->post_title}</a></h4>";
        $return .= "<a href='{$wp_qry->post->guid}'><img src='{$thumb[0]}' width='{$a['ancho_img']}' height='{$a['alto_img']}' class='tarimas-teaser-img' /></a>$div_precio";
        $return .= "</div><!--tt-unit-->";
    endwhile;
endif;
$return .= "</div><!-- ttttt-container -->";

return $return;

我什至在构造的代码上都没有换行符。然而我明白了:

<div class='tarimas-teaser-container'>
<div class='tarimas-teaser-unit'>
<h4><a href='http://www.tarimasterhurne.es/productos/roble-blanco-arena-1199020372/'>Roble Blanco Arena</a></h4>
<p><a href='http://www.tarimasterhurne.es/productos/roble-blanco-arena-1199020372/'><img src='http://www.tarimasterhurne.es/wp-content/uploads/2012/07/1199020372_main-150x150.jpg' width='100' height='100' class='tarimas-teaser-img' /></a>
<div class='precio mini'>10,93</div>
</div>
<p><!--tt-unit-->
<div class='tarimas-teaser-unit'>
<h4><a href='http://www.tarimasterhurne.es/productos/roble-marron-rojo-1199020368/'>Roble Marrón Rojo</a></h4>
<p><a href='http://www.tarimasterhurne.es/productos/roble-marron-rojo-1199020368/'><img src='http://www.tarimasterhurne.es/wp-content/uploads/2012/07/1199020368_main-150x150.jpg' width='100' height='100' class='tarimas-teaser-img' /></a>
<div class='precio mini'>11,03</div>
</div>
<p><!--tt-unit-->
<p><!-- ttttt-container --></p>

这让我疯狂。再说一遍:我已经在 functions.php 中删除了 wp_autofilter。

4

1 回答 1

1

是的,一些疯狂的插件。

检查每个插件...启用和禁用每个插件

于 2012-08-17T14:23:31.517 回答