Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $i = 1; // Start from 1
- if ($ajax_query->have_posts()) :
- while ($ajax_query->have_posts()) :
- $ajax_query->the_post();
- update_post_meta( get_the_ID(), 'the_custom_field', $i++ );
- // $i++ will be the specific number for each my post.
- endwhile;
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement