おそらく返りの問題だと思います。だから私はコンテンツを分割し、一つはthelist
という関数で返し、もう一つはそれを返す実際の関数です。コードはその質問に続く。私はそれが必要な場所ではなく、コンテンツの先頭にショートコードが出る
実際のショートコードは機能しますが、残りのコンテンツよりも前に表示されます。私はnow_include_post
の返品がそれを修正すると思ったが、そうはしなかった。誰でも助けることができますか?
function thelist() {
if (have_posts()) : while (have_posts()) : the_post();
?>
<div id="post-<?php the_ID(); ?>" <?php post_class('thumb'); ?>>
<a href="<?php the_permalink() ?>" class="thumb-link">
<?php
if (!post_password_required()) {
if (has_post_thumbnail()) {
the_post_thumbnail();
}
} else {
?>
<img src="<?php bloginfo('template_url') ?>/img/locked.png" />
<?php } ?>
</a>
<h2>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
</h2>
</div>
<?php /* end post */ ?>
<?php
endwhile;
endif;
wp_reset_query();
}
?>
<?php
function now_include_post($atts) {
$thepostid = intval($atts[id]);
query_posts("p=$thepostid");
$output .= thelist();
return $output;
}
これは本当に例外的です。あなたの助けとそのリンクをありがとう! – user1368968
それは2014年で、2年後にあなたの返信は私を保存:)ありがとう! –
それは私のために働く。 ありがとう –