4

3つの投稿リンクをヘッダーとして表示する投稿ループ(index.php)があり、その上に投稿のスラッグに基づいたスライドショーがあります。

<div class="nuotraukos">
<?php if (have_posts()) : ?>
<?php $nuotraukos = new WP_Query('category_name=nuotraukos&showposts=3');
while ($nuotraukos->have_posts()) : $nuotraukos->the_post();
$do_not_duplicate = $post->ID; ?>
<div class="post" id="post-<?php the_ID(); ?>">
    <p class="postmetadata"><?php edit_post_link(__('Edit')); ?></p>
        <div class="entry">

            <?php  

                if ( function_exists( 'meteor_slideshow' ) ) {
                $slug = basename(get_permalink());
                meteor_slideshow('' . $slug. ''); 
                }

                 the_content('<h2>' . get_the_title() . '</h2>');

            ?>

        </div>
    </div>

<?php endwhile; ?>
<?php endif; ?>

Meteorスライドショーにはループ自体があり、最初のクエリの後でpostループをキャンセルすると思います。そのため、 http://studioglamour.co.ukで確認できるタイトルを1つだけ印刷します(ただし、3回表示します)。

スライドショーの下に表示される3つの異なるリンクが必要ですが、これを修正する方法がわかりません。

4

1 に答える 1

1

試す

$slug = basename(get_permalink($nuotraukos->post->ID));
...
the_content('<h2>' . get_the_title($nuotraukos->post->ID) . '</h2>');
于 2012-10-27T17:31:14.467 に答える