How to add a second content section when using certain page template

You could add a metabox for your second content section, then hide it with a bit of javascript if the current template isn’t a specific template: current_template = jQuery(‘#page_template’).val(); if( current_template != ‘my-special-template.php’ ){ jQuery(‘#_your_meta_box_id’).hide(); } then bind a function to the change event of the template dropdown and show it when a specific template … Read more

Custom post.php

To remove Preview Button function posttype_admin_css() { global $post_type; $post_types = array( /* set post types */ ‘post_type_name’ ); if(in_array($post_type, $post_types)) echo ‘<style type=”text/css”>#post-preview, #view-post-btn{display: none;}</style>’; } add_action( ‘admin_head-post-new.php’, ‘posttype_admin_css’ ); add_action( ‘admin_head-post.php’, ‘posttype_admin_css’ ); To remove slug function vipx_remove_cpt_slug( $post_link, $post, $leavename ) { if ( ‘post_type_name’ != $post->post_type || ‘publish’ != $post->post_status ) … Read more