我的短码输出总是出现在我的自定义模板的顶部。短码输出总是显示在自定义模板的顶部
自定义模板
$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(),我在其他帖子中阅读,但仍然无法正常工作。
'模式,aweber.php'这是当前的HTML,我需要在HTML一个特定的地方进行打印。 –