正如@s\\u ha\\u dum所说,那些噩梦般的“模板标记”样式的条件语句使得很难找到这些错误。请使用define( \'WP_DEBUG\', true );
在您的wp config文件中打印这些PHP错误。
function lande_galleri_parameter($atts) {
extract( shortcode_atts( array (
\'post_type\' => \'embm_beer\',
\'order\' =>\'date\',
\'orderby\' => \'title\',
\'posts\' => -1,
\'land\' => \'\',
), $atts));
$options = array(
\'post_type\' => $post_type,
\'order\' => $order,
\'orderby\' => $orderby,
\'posts_per_page\' => $posts,
\'land\' => $land,
);
$out = \'\';
$query = new WP_Query($options);
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
$out .= \'<div class="findoel"><a href="\' . get_permalink( get_the_ID() ) . \'" title="\' . esc_attr( get_the_title() ) . \'">\';
$out .= get_the_post_thumbnail( get_the_ID(), \'medium\');
$out .= \'</a></div>\';
}
}
wp_reset_postdata();
return $$out;
}
add_shortcode(\'lande_galleri\', \'lande_galleri_parameter\');