Кастомный луп на основе плагина?

У плагина WordPress Popular Posts есть возможность вывода данных через следующий код:
<?php
	$args = array(
		'range' => 'all', 
		'excerpt_length' => 55,
		'posts_per_page' => 10,
		'thumbnail_width' => 225,
                'thumbnail_height' => 135,
                'wpp_start' => '<ul class="wpp-grid">',
                'post_html' => '<li>{thumb_img} {title}</li>'
	);

	wpp_get_mostpopular( $args );
    ?>

Я пытаюсь добавить в предыдущий код следующее:
if ( $custom_query->have_posts() ) :
    while( $custom_query->have_posts() ) : $custom_query->the_post(); ?>

        <article <?php post_class(); ?>>
            <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
            <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
            <div><?php the_excerpt(); ?></div>
        </article>

    <?php
    endwhile;
    ?>

и плюс пагинацию
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>

Но в итоге получаю 500 ошибку. Я в php полный 0, видимо, где-то портачу. Мой полный код, который выдает ошибку такой:
<?php
	$args = array(
		'range' => 'all', 
		'excerpt_length' => 55,
		'posts_per_page' => 10
	);

	$custom_query = wpp_get_mostpopular( $args );
if ( $custom_query->have_posts() ) :
    while( $custom_query->have_posts() ) : $custom_query->the_post(); ?>

        <article <?php post_class(); ?>>
            <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(215, 130, true)); ?></a>
    <h2 class="title-main"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
            <div><?php the_excerpt(); ?></div>
        </article>

    <?php
    endwhile;
    ?>

<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>

Буду благодарен за помощь и подсказки, как правильно отредактировать код.
  • Вопрос задан
  • 63 просмотра
Пригласить эксперта
Ответы на вопрос 1
Chefranov
@Chefranov
Новичок
У вас в конце кода лишний закрывающий тег PHP ?>
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы