Skip to content

Commit

Permalink
Add support for custom WordPress backgrounds. Makes switching backgro…
Browse files Browse the repository at this point in the history
…und image or color in HTML5Press very easy.
  • Loading branch information
tlongren committed Oct 7, 2011
1 parent d06729e commit 9e7e35b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functions.php
Expand Up @@ -36,11 +36,12 @@ function html5press_theme_setup() {
$locale_file = TEMPLATEPATH . "/languages/$locale.php";
if ( is_readable( $locale_file ) )
require_once( $locale_file );
add_theme_support( 'post-formats', array( 'link','quote','status' ) );
add_theme_support( 'post-formats', array( 'link','quote','status' ) ); // support for post formats
add_theme_support( 'post-thumbnails' ); // post thumbnails
register_nav_menu( 'main-menu', __('Main Menu','html5press') ); // navigation menus
add_theme_support( 'automatic-feed-links' ); // automatic feeds
add_image_size('bxthumb', 200, 200, true);
add_image_size('bxthumb', 200, 200, true); // featured post slider image size
add_custom_background(); // enable custom backgrounds
}

// Register all the javascript
Expand Down

3 comments on commit 9e7e35b

@jayj
Copy link
Contributor

@jayj jayj commented on 9e7e35b Oct 7, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested anything but a custom background will properly be resized to 16x16 pixel because of background-size: 16px 16px; in style.css

If that's the case you should use a callback function to reset the background-size to auto if the user has a custom background image. See http://devpress.com/blog/custom-background-fix-for-theme-developers/ for inspiration on how to do it

@tlongren
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct Jesper! I hadn't tested with anything other than repeating as a tile. If tiling is disabled, the background shows as 16x16. I'll get a fix in place right away. Thanks for pointing that out!

@tlongren
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should take care of it @jayj:
784bf80

Thank you again!

Please sign in to comment.