Title: Pro &#8211; Custom template &#8211; adding conditional css
Last modified: August 22, 2016

---

# Pro – Custom template – adding conditional css

 *  Resolved [shecodes](https://wordpress.org/support/users/shecodes/)
 * (@shecodes)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/pro-custom-template-adding-conditional-css/)
 * I have added an additional custom field to the widget area custom template by
   modifying the weather-widget-pro.php file.
 * `$weather->buggy_status = isset($atts['buggy_status']) ? $atts['buggy_status']:
   false;`
 * I basically found all the lines for ‘override_title’, copied them and then replaced
   with my custom field ‘buggy_status’.
 * But now I’m stuck on how I add a class to the div containing this field based
   on its value, given that the custom field ‘buggy_status’ will have only two value
   options which will either be ‘available’ or ‘unavailable’? I want to be able 
   to apply a red or green border via css based on the value.
 * The code for this field on my awe_custom.php file is:
 * `<div><?php _e('buggies:', 'awesome-weather-pro'); ?> <?php echo $weather->buggy_status;?
   ></div>`
 * which I would like to have the class of ‘buggy-yes’ or ‘buggy-no’ applied to 
   the surrounding div tag.
 * Hoping you can help,
 * Thanks!
 * [https://wordpress.org/plugins/awesome-weather/](https://wordpress.org/plugins/awesome-weather/)

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

 *  Plugin Author [Hal Gatewood](https://wordpress.org/support/users/halgatewood/)
 * (@halgatewood)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/pro-custom-template-adding-conditional-css/#post-5591771)
 * Do you get any value for $weather->buggy_status yet?
 * Can you email me at [hal@halgatewood.com](https://wordpress.org/support/topic/pro-custom-template-adding-conditional-css/hal@halgatewood.com?output_format=md)?
   It should be faster that way.
 *  Thread Starter [shecodes](https://wordpress.org/support/users/shecodes/)
 * (@shecodes)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/pro-custom-template-adding-conditional-css/#post-5591911)
 * Oh I am so sorry I have only just spotted your reply : (
    I will email you now.

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

The topic ‘Pro – Custom template – adding conditional css’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/awesome-weather_ad7c7d.svg)
 * [Awesome Weather Widget](https://wordpress.org/plugins/awesome-weather/)
 * [Support Threads](https://wordpress.org/support/plugin/awesome-weather/)
 * [Active Topics](https://wordpress.org/support/plugin/awesome-weather/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/awesome-weather/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/awesome-weather/reviews/)

## Tags

 * [custom-template](https://wordpress.org/support/topic-tag/custom-template/)

 * 2 replies
 * 2 participants
 * Last reply from: [shecodes](https://wordpress.org/support/users/shecodes/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/pro-custom-template-adding-conditional-css/#post-5591911)
 * Status: resolved