我已设置为使用标准之外的post格式库和视频。我正在编辑循环单。php为每个帖子格式提供不同的布局,但我要为每个帖子格式包含get\\u template\\u部分。
这就是我所拥有的:
<?php
/**
* The loop that displays a single post.
*
* The loop displays the posts and the post content. See
* http://codex.wordpress.org/The_Loop to understand it and
* http://codex.wordpress.org/Template_Tags to understand
* the tags used in it.
*
* This can be overridden in child themes with loop-single.php.
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.2
*/
?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php
if ( has_post_format( \'gallery\' )) {
// code to display the gallery format post here
get_template_part( \'news\' \'gallery\' ); // News Gallery Template (news-gallery.php)
} else if (has_post_format(\'video\')) {
// stuff to display the video format post here
get_template_part( \'news\' \'video\' ); // News Gallery Template (news-video.php)
}else {
// code to display the normal format post here
get_template_part( \'news\' \'standard\' ); // News Gallery Template (news-standard.php)
}
<?php endwhile; // end of the loop. ?>
?>
我测试时出现了一个错误:
分析错误:语法错误,在/home/judddev/public\\u html/pitch/wp content/themes/pitch/loop single中出现意外的T\\u CONSTANT\\u ENCAPSED\\u字符串。php第26行
任何帮助都将不胜感激。