<?php if ( $paged < 2 ) :
echo \'some text\';
$published_posts = wp_count_posts( \'item\' );
printf( "<p>%s%s%s%s%s</p>",
\'Text...\',
isset( $published_posts->publish ) ? $published_posts->publish : \'\',
\'text...\',
do_shortcode( "[count]" ),
\'text...\' );
else :
?>some other text<?php
endif; ?>
您可以使用任何功能组合来完成工作,并帮助您有效地了解自己在做什么。
<?php if ( 2 > $paged ) :
?>some text<?php
$published_posts = wp_count_posts( \'item\' );
printf ( "<p>%s%s%s%s%s</p>",
\'Text...\',
isset( $published_posts->publish ) ? $published_posts->publish : \'\',
\'text...\',
do_shortcode( "[count]" ),
\'text...\' );
else :
echo implode( PHP_EOL, array (
\'some\',
\'other\',
\'text\',
) );
endif; ?>
如果你的嵌套真的失控了,那么创建可以
included.
include TEMPLATEPATH . \'/template-name.php\';
load_template( TEMPLATEPATH . \'/template-name.php\' );
locate_template( $template_names, $load );
include( get_query_template( \'template-name\' ) );
get_template_part( $slug, $name );