0

以下で使用しているクエリに問題があると思います。それぞれ独自のいいねボタンを備えた複数のサムネイルを表示したい。すべて正常に動作しますが、1 つのボタンを押すと、他のすべての画像も同様に機能します。リセットクエリを試しましたが、うまくいかないか、何かが間違っていると思います。誰かが同様の問題を抱えているか、これを修正する方法を知っていますか?

        <?php query_posts('cat=1'); ?>
        <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); ?>
        <?php $thumb = get_post_meta($post->ID, 'thumb', $single = true); ?>
            <ul>
                <li>
                <a href="<?php the_permalink() ?>" title="View <?php the_title(); ?>'s showcase"><img src="<?php echo $thumb; ?>" alt="View <?php the_title_attribute(); ?>'s showcase" width="150" height="111" /></a>  
                    <div class="design"><a href="<?php the_permalink() ?>" title="View <?php the_title(); ?>'s showcase"><?php the_title(); ?></a></div>
                    <div class="subtitle"><a href="<?php the_permalink(); ?>">view feature</a></div>
                    <!-- AddThis Button BEGIN -->
                    <div class="addthis_toolbox addthis_default_style ">
                    <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
                    </div>
                    <!-- AddThis Button END --> 
                </li>
            </ul>
        <?php endwhile; ?>    
        <?php else : ?>    
        <?php endif; ?>
        <?php wp_reset_query() ?>
4

1 に答える 1

1

いいねボタンに fbml href 属性を追加します。

<a class="addthis_button_facebook_like" fb:like:layout="button_count" fb:like:href="<?php the_permalink(); ?>"></a>
于 2012-04-14T09:12:55.337 に答える