【发布时间】:2017-03-03 19:03:27
【问题描述】:
我的简码输出总是出现在我的自定义模板的顶部。
自定义模板
$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。