私のショートコード出力は常に自分のカスタムテンプレートの一番上に表示されます。ショートコード出力は常にカスタムテンプレートの先頭に表示されます
カスタムテンプレート
$tag= 'the_content';
remove_all_filters($tag);
$postid = get_the_ID();
$post = get_post($postid);
$content = do_shortcode($post->post_content);
ob_start();
echo $content;
$result = ob_get_contents();
ob_end_clean();
return $result;
カスタムショート
function signupform_shortcode($atts) {
extract(shortcode_atts(array(
'socialmkt' => 'aweber'
), $atts));
if($socialmkt == 'aweber'){
if($display == 'popup') {
return include_once('modal-aweber.php');
}
}
}
add_shortcode('signupform', 'signupform_shortcode');
それはHTMLの着陸の途中の場所ですショート。 私は他の投稿で読んだがまだ動作していないob_start()を追加しようとしています。
'modal-aweber.php'これはhtmlの特定の場所に印刷する必要がある現在のhtmlです。 –