Support » Themes and Templates » Where to find code for 2011 bg options

  • Hi folks
    I am messing around with a 2011 child theme and wondering how hard it would be to add an option to the admin>appearance>background panel…

    I would like to be able to give users the option of changing the vertical alignment of the background image instead of just the horizontal

    I know this can be very easily done by the child theme’s style.css, but how to provide it as an option?

    I did find sites with tutorials on adding options for the theme Options panel, but not the background panel…. As I type that I realise that the background panel may not actually be part of the theme… It wasnt there in older versions of WP if I remember correctly, but I havent found any 2011 theme files relate to it so far (not finished looking though).

    Any help appreciated, thanks! 🙂
    Happy Christmas.

Viewing 1 replies (of 1 total)
  • OK on the back of my thought at the end of the last post I found wp-admin/custom-background.php and its take_action() function.

    A) is it possible to override this in a child theme like manner, or will I need to actually alter this file?
    B) if I need to alter the file, can I safely add a new if(){…} to the function just before $this->updated = true; and add the code for displaying it something like:

    <tr valign="top">
    <th scope="row"><?php _e( 'Vertical Position' ); ?></th>
    <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Vertical Position' ); ?></span></legend>
    <input name="background-vertical-position" type="radio" value="top"<?php checked('top', get_theme_mod('background_vertical_position', 'left')); ?> />
    <?php _e('Top') ?>
    <input name="background-vertical-position" type="radio" value="middle"<?php checked('middle', get_theme_mod('background_vertical_position', 'left')); ?> />
    <?php _e('Middle') ?>
    <input name="background-vertical-position" type="radio" value="bottom"<?php checked('bottom', get_theme_mod('background_vertical_position', 'left')); ?> />
    <?php _e('Bottom') ?>

    Prob not that easy, am pretty n00b at PHP though, only learning as I go, just enough to get by…
    Thanks for any help

Viewing 1 replies (of 1 total)
  • The topic ‘Where to find code for 2011 bg options’ is closed to new replies.