ThemeShaper Forums » Thematic

Remove asides from widget admin panel

(6 posts)
  • Started 5 years ago by MontanaMax
  • Latest reply from Chris
  • This topic is not resolved

Tags:

  1. I'm trying to remove the unused aside areas in the widget panel for a client's theme I'm working on (the extra widget areas in the admin panel are really confusing the end user).

    Is there a way I can do this cleanly in the functions.php file without hacking into the main thematic widgets.php file?

    Thanks,

    - Jon

    Posted 5 years ago #
  2. Hi Jon,

    this can be done in your functions.php using:

    unregister_sidebar( $name )

    $name is the ID of the sidebar

    Could be that you need to wrap this into a function and add this one as an action to 'init'. Sorry .. can't test this at the moment.

    Chris

    Posted 5 years ago #
  3. No luck with this one - I did find the wordpress documentation for this function call as well, but I couldn't find a way to make it work in the child theme functions.php - either by itself or wrapped in an init call. Not sure if there's some order of operations issue, or if I need to pass the parameter as an array or something.

    One of the simpler code snippets I tried went:

    unregister_sidebar('1st-subsidiary-aside');

    For the short term I went ahead and hacked the main thematic widgets.php file to get things rolling for the project, but if someone knows of a way to make this work correctly that would be great.

    Thanks,

    - Jon

    Posted 5 years ago #
  4. Hi,

    sorry .. this was my fault. The function needs to be connected to 'wp-head' instead of 'init'.

    Need to do some more research. If you remove 'primary-aside' it'll keep its CSS markup. Let me see if I can find another hook.

    Chris

    Posted 5 years ago #
  5. I think admin_init is what you're looking for. This code is working for me

    function child_remove_widget_area() {
    unregister_sidebar('primary-aside');
    }
    add_action( 'admin_init', 'child_remove_widget_area');
    Posted 5 years ago #
  6. Thanks a lot for your help!

    Posted 5 years ago #

RSS feed for this topic

Reply

You must log in to post.