Wordpress: как вывести краткое описание произвольных записей?

Здравствуйте.
Создал произвольный тип записей:

function codex_custom_init() {
register_post_type( 'BLA',
         array(
                'labels' => array( 
                'name' => __( 'BLA' ),
                'singular_name' => __( 'BLA' ),
                'has_archive' => true,
                'add_new' => 'Добавить новый BLA',
                'not_found' => 'Ничего не найдено',
                'not_found_in_trash' => 'BLA не найдено'
                ),
                'public' => true,
                'has_archive' => true,
                'supports' => array( 
                    'title',
                    'editor',
                    'author',
                    'thumbnail',
                    'page-attributes',
                    'post-formats',
                ),
               'taxonomies' => array('category', 'post_tag') 
           ));
flush_rewrite_rules( false );
}
add_action('init', 'codex_custom_init', 1);


Подскажите, как вывести краткое описание, только этих записей (записей BLA)?

Я так понимаю, наподобие

<?php $the_query = new WP_Query( 'showposts=4' ); ?>

<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); the_date() ?></a></li>

<li><?php the_excerpt(__('(more…)')); ?></li>
<?php endwhile;?>
</ul>


Только куда впихнуть bla?

Спасибо!
  • Вопрос задан
  • 3262 просмотра
Решения вопроса 2
Комментировать
maxxannik
@maxxannik
Сайты на WordPress + Интернет магазины WooCommerce
<?php $the_query = new WP_Query( 'post_type=bla&showposts=4' ); ?>

<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<?php the_title(); the_date() ?>

<?php the_excerpt(__('(more…)')); ?>
<?php endwhile;?>
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

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

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