This topic has 2 replies, 2 voices, and was last updated 8 years by clyn.

  • Author
  • #101281
     clyn
    Participant

    I dont want to use Adminimize pluging (because using some little codes to hide metabox on function.php) and how can i disable or hide sidebar on custom post type screen.  Sidebar will only pages and normal post…. I am adding picture.

    Any code add to function.php ?

    thanks

    Attachments:
    You must be logged in to view attached files.
    #101551
     sharmstr
    Moderator

    Change portfolio to your cpt name

    COPY CODE
    
    if ( is_admin() )  {
        add_action('do_meta_boxes', 'remove_cpt_meta_boxes');
    }
    
    function remove_cpt_meta_boxes()
        {
            if ( get_post_type() == 'portfolio' ) {
                remove_action('edit_form_advanced', array('sidebar_generator', 'edit_form'));
                remove_action('edit_page_form', array('sidebar_generator', 'edit_form'));
            }
        }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #101560
     clyn
    Participant

    You are great, its work very fine…

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?