Skip to content

Instantly share code, notes, and snippets.

@jpen365
Created September 21, 2016 04:53
Show Gist options
  • Save jpen365/1c7a154114bd8efa9c5f4906d08b9460 to your computer and use it in GitHub Desktop.
Save jpen365/1c7a154114bd8efa9c5f4906d08b9460 to your computer and use it in GitHub Desktop.
<?php
/* Add a field to the metabox */
function jpen_custom_post_order( $post ) {
wp_nonce_field( basename( __FILE__ ), 'jpen_custom_post_order_nonce' );
$current_pos = get_post_meta( $post->ID, '_custom_post_order', true); ?>
<p>Enter the position at which you would like the post to appear. For exampe, post "1" will appear first, post "2" second, and so forth.</p>
<p><input type="number" name="pos" value="<?php echo $current_pos; ?>" /></p>
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment