我已經設置爲使用後格式畫廊和視頻除了標準。我正在編輯loop-single.php,爲每個帖子格式提供不同的佈局,但是我要爲每個帖子格式包含get_template_part。WordPress的:後格式single-loop.php使用get_template_part
這是我有:
<?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. ?>
?>
它想出一個錯誤,當我測試:
解析錯誤:語法錯誤,意想不到的T_CONSTANT_ENCAPSED_STRING在/ home/judddev /的public_html /音調/ wp-content/themes/pitch/loop-single.php on line 26
任何幫助將不勝感激。
什麼是26行? – Toto
get_template_part('news''gallery'); //新聞圖庫模板(news-gallery.php)Apprently – Guy