私もここは比較的新参者です。
ショートコードはおそらく表示されthe_excerpt()
ていません。これは、ショートコードまたは html をレンダリングしないためです。
この「問題」を解決する方法はたくさんあります
これを試すことができると思います:
add_filter( 'the_content', 'ssba_the_content_filter' );
function ssba_the_content_filter( $content ) {
$new_content = $content;
$new_content .= do_shortcode( '[ssba]' );
return $new_content;
}
このコードを functions.php に配置します
これにより、[ssba] ショートコードがすべてのテーマの最後に自動的に追加the_content()
さthe_excerpt()
れます。このソリューションを使用すると、すべての投稿でこの情報を手動で入力する必要はありません
必要に応じて、内部でコンディショナル タグを使用できるので、必要なページにのみ追加できます。
add_filter( 'the_content', 'ssba_the_content_filter' );
function ssba_the_content_filter( $content ) {
$new_content = $content;
if( is_single() ) {
$new_content .= do_shortcode( '[ssba]' );
}
return $new_content;
}
do_shortcode()
またはAgmlauncherが言ったように、ループで使用できます。
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
echo '<div>';
the_content();
echo do_shortcode('[ssba]');
echo '</div>';
} // end while
} // end if
下手な英語でごめんなさい。