Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Remove Genesis Framework inpost layout box for posts only
* Don't show layout box on posts, only pages
* @author Joshua David Nelson,
add_action( 'init', 'jdn_remove_inpost_layouts' );
function jdn_remove_inpost_layouts() {
// Bail if it's not an admin
if( !is_admin() )
// Method from Ross McCay:
global $typenow;
// when editing pages, $typenow isn't set until later!
if (empty($typenow)) {
// try to pick it up from the query string
if (!empty($_GET['post'])) {
$post = get_post($_GET['post']);
$typenow = $post->post_type;
// try to pick it up from the quick edit AJAX post
elseif (!empty($_POST['post_ID'])) {
$post = get_post($_POST['post_ID']);
$typenow = $post->post_type;
// Verify we're on the post page
if( !isset( $typenow ) || $typenow != 'post' )
// Remove the inpost layout action
remove_action( 'admin_menu', 'genesis_add_inpost_layout_box' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.