我使用一个短代码通过循环名称引入不同的循环。php。出于某种原因,它总是在页面的顶部。我在google上搜索了它,使用echo而不是return导致了这个问题,但我的代码没有使用echo。以下是短代码:
// setup the shortcode for use
function friendly_loop_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
\'category\' => \'\',
\'module\' => \'\'
), $atts ) );
include(locate_template(\'loop-\'.$module.\'.php\'));
}
知道为什么会这样吗?