Answer the question
In order to leave comments, you need to log in
Wordpress: how to display a short description of custom posts?
Hello.
Created custom post type:
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);
<?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>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question