Support » Fixing WordPress » How to convert post title into a number.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    do you mean how to give each post a number, starting with 1 for the oldest post, and increasing with each new post?

    then check this article
    you probably need to adapt the code to do it only for posts of one category

    how can I display it in the loop?

    Would that be correct?

    `<?php $my_query = new WP_Query(‘category_name=przekazy’);
    while ($my_query->have_posts()) : $my_query->the_post();
    $do_not_duplicate = $post->ID;?>
    <?php echo get_post_meta($post->ID,’incr_number’,true); ?>
    <?php endwhile; ?>`

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to convert post title into a number.’ is closed to new replies.