Change meta on all posts

<?php query_posts('showposts=-1'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php

$custom_field_name = 'Sort Order';
$desired_field_value = '100';

add_post_meta($post->ID,$custom_field_name,$desired_field_value,true);
the_title();
echo ' - ' . get_post_meta($post->ID,$custom_field_name,true);
echo'<br>';

?>
<?php endwhile; endif; ?>

0 Comments

You must be logged in to post a comment.