Force slug to be visible and stick to top of post. Possibly sidebar

The title pretty much says it all. In a post/any post type, how can I a) force the slug field to be displayed (slugdiv) and b) stick the field to the top of the post. Below the title. Maybe even better: to the right sidebar.

I’ve managed to force show the the slug field with the snippet below, but ordering/ sticking it to the top i haven’t gotten a hold.

Any suggestions?

<?php

add_filter(‘default_hidden_meta_boxes’, ‘show_hidden_meta_boxes’, 10, 2);

function show_hidden_meta_boxes($hidden, $screen) {
if ( ‘post’ == $screen->base ) {
foreach($hidden as $key=>$value) {
if (‘slugdiv’ == $value) {
unset($hidden[$key]);
break;
}
}
}

return $hidden;
}

Cheers

Read more here:: Force slug to be visible and stick to top of post. Possibly sidebar

Leave a Reply

Your email address will not be published. Required fields are marked *