D
D
Denis Anikin2016-04-04 11:15:13
WordPress
Denis Anikin, 2016-04-04 11:15:13

How to display category IDs using php?

<div class="col-md-4 animation_3 personal_last_block">
                    <?php if ( have_posts() ) : query_posts('p=30');
                    while (have_posts()) : the_post(); ?>
                    <h3><?php the_title(); ?></h3>
                    <h2 class="personal_header"><?php echo get_bloginfo('name'); ?></h2>
                    <?php the_content(); ?>
                <? endwhile; endif; wp_reset_query(); ?>

To automate, we insert 'cat=' instead of 'p=30' . $id and something and somewhere else you need to add like ($post->ID) but where and what exactly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question