+<input name="background-preset" type="hidden" value="custom">
+
+<?php
+$background_position = sprintf(
+ '%s %s',
+ get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ),
+ get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) )
+);
+
+$background_position_options = array(
+ array(
+ 'left top' => array( 'label' => __( 'Top Left' ), 'icon' => 'dashicons dashicons-arrow-left-alt' ),
+ 'center top' => array( 'label' => __( 'Top' ), 'icon' => 'dashicons dashicons-arrow-up-alt' ),
+ 'right top' => array( 'label' => __( 'Top Right' ), 'icon' => 'dashicons dashicons-arrow-right-alt' ),
+ ),
+ array(
+ 'left center' => array( 'label' => __( 'Left' ), 'icon' => 'dashicons dashicons-arrow-left-alt' ),
+ 'center center' => array( 'label' => __( 'Center' ), 'icon' => 'background-position-center-icon' ),
+ 'right center' => array( 'label' => __( 'Right' ), 'icon' => 'dashicons dashicons-arrow-right-alt' ),
+ ),
+ array(
+ 'left bottom' => array( 'label' => __( 'Bottom Left' ), 'icon' => 'dashicons dashicons-arrow-left-alt' ),
+ 'center bottom' => array( 'label' => __( 'Bottom' ), 'icon' => 'dashicons dashicons-arrow-down-alt' ),
+ 'right bottom' => array( 'label' => __( 'Bottom Right' ), 'icon' => 'dashicons dashicons-arrow-right-alt' ),
+ ),
+);
+?>
+<tr>
+<th scope="row"><?php _e( 'Image Position' ); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Image Position' ); ?></span></legend>
+<div class="background-position-control">
+<?php foreach ( $background_position_options as $group ) : ?>
+ <div class="button-group">
+ <?php foreach ( $group as $value => $input ) : ?>
+ <label>
+ <input class="screen-reader-text" name="background-position" type="radio" value="<?php echo esc_attr( $value ); ?>"<?php checked( $value, $background_position ); ?>>
+ <span class="button display-options position"><span class="<?php echo esc_attr( $input['icon'] ); ?>" aria-hidden="true"></span></span>
+ <span class="screen-reader-text"><?php echo $input['label']; ?></span>
+ </label>
+ <?php endforeach; ?>
+ </div>
+<?php endforeach; ?>
+</div>
+</fieldset></td>
+</tr>
+