S
S
Sebastian Pereira2014-03-16 23:24:07
PHP
Sebastian Pereira, 2014-03-16 23:24:07

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);

Tell me how to display a short description, only these records (BLA records)?
As I understand it, it's like
<?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>

But where to shove bla?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zelenin, 2014-03-17
@uJlJluduAH

codex.wordpress.org/Class_Reference/WP_Query

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question