Я установил для использования галерею форматов и видео в дополнение к стандарту. Я редактирую loop-single.php, чтобы дать ему разные макеты для каждого формата сообщения, но я должен включить get_template_part для каждого формата сообщения.Wordpress: Post Format single-loop.php using 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 в/главная/judddev/public_html/pitch/wp-content/themes/pitch/loop-single.php on line 26
Любая помощь была бы принята с благодарностью.
Что такое линия 26? – Toto
get_template_part ('news' 'gallery'); // News Gallery Template (news-gallery.php) Возможно – Guy