Uncategorized WordPress

Let your users pick a header, but not add one

WordPress 3.0 added the ability for themes to easily allow custom headers. Users could pick one that the theme shipped with, or upload their own. But what if you run a branded multisite instance where you don’t want your users to be able to upload their own, but you still want them to easily be able to pick one? Now in WordPress 3.1, you can do just that.

So how do we do this?

Just paste the following code in your theme (or child theme) functions.php file.
[php]add_action(‘init’, ‘jorbin_remove_custom_header_uploads’, 11);

function jorbin_remove_custom_header_uploads(){
remove_theme_support( ‘custom-header-uploads’ );

If that’s not easy enough, check out The remove custom header uploads plugin in the WordPress plugin directory

4 replies on “Let your users pick a header, but not add one”

I’d never really thought about only giving users the functionality to just pick a header, and not upload their own. That’s some neat 4 lines of code! 😀 Who was it saying actions/filters for the world, oh yeah, think it was Justin Tadlock? — Something like that shows you really how simple they are though!

It makes the most sense if you are running a community site where you want to allow your users to have a range of choices of different branded headers. Think a university that wants all the pictures to be of the campus.

Actions and Filters do make many things possible. The WordPress API is always getting better and better.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.