Title: [Plugin: Options Framework] background settings
Last modified: August 20, 2016

---

# [Plugin: Options Framework] background settings

 *  Resolved [uili](https://wordpress.org/support/users/uili/)
 * (@uili)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-options-framework-background-settings/)
 * im trying to output the background settings, what i have is this:
 *     ```
       <body <?php body_class(); ?><?php $background = of_get_option('background');
          if ($background) {
          if ($background['image']) {
          echo 'style="background:url('.$background['image']. ') ';
       	foreach ($background as $i=>$param){
               echo 'background-'.$i .'= '.$param.' ' ;
               }
          }
          } else {
          echo 'style="background-color:'.$background['color'].'';
          }; ?>>
       ```
   
 * what i get is:
 * `<body class="home" background-attachment="scroll" center="" background-position
   ="top" background-repeat="no-repeat" background-image="http://127.0.0.1:8080/
   wilson/wp-content/uploads/2011/08/bg_body1.jpg" background-color="#000000">`
 * how do i fix this?!
    by the way, niiiice plugin!!
 * [http://wordpress.org/extend/plugins/options-framework/](http://wordpress.org/extend/plugins/options-framework/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [uili](https://wordpress.org/support/users/uili/)
 * (@uili)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-options-framework-background-settings/#post-2241156)
 * i did it doing
 *     ```
       <?php $background = of_get_option('background');
         if ($background) {
           if ($background['image']) {
           echo ' style="background:url('.$background['image'].') '.' '. $background['color'] .' '. $background['repeat'] .' '. $background['position'] .' '. $background['attachment'] .';"';
           }else{
           echo ' style="background-color:'.$background['color'].'"';
           }
         };
       ?>
       ```
   
 *  Plugin Author [Devin Price](https://wordpress.org/support/users/downstairsdev/)
 * (@downstairsdev)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-options-framework-background-settings/#post-2241231)
 * You should output it as part of the CSS in the head. Look at how I output CSS
   in Portfolio Press: [http://wordpress.org/extend/themes/portfolio-press](http://wordpress.org/extend/themes/portfolio-press)
 *  Plugin Author [Devin Price](https://wordpress.org/support/users/downstairsdev/)
 * (@downstairsdev)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-options-framework-background-settings/#post-2241232)
 * Or, better yet, use the native background capabilities: [http://codex.wordpress.org/Function_Reference/add_custom_background](http://codex.wordpress.org/Function_Reference/add_custom_background)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Options Framework] background settings’ is closed to new replies.

 * ![](https://ps.w.org/options-framework/assets/icon-256x256.png?rev=977481)
 * [Options Framework](https://wordpress.org/plugins/options-framework/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/options-framework/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/options-framework/)
 * [Active Topics](https://wordpress.org/support/plugin/options-framework/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/options-framework/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/options-framework/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Devin Price](https://wordpress.org/support/users/downstairsdev/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-options-framework-background-settings/#post-2241232)
 * Status: resolved