Advertisement
srikat

Untitled

Dec 9th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function altitude_widget_area_class( $id ) {
  2.  
  3. $count = altitude_count_widgets( $id );
  4.  
  5. $class = '';
  6.  
  7. if ( 1 === $count ) {
  8. $class .= ' widget-full';
  9. } elseif ( 1 === $count % 3 && 7 !== $count ) {
  10. $class .= ' widget-thirds';
  11. } elseif ( 1 === $count % 4 ) {
  12. $class .= ' widget-fourths';
  13. } elseif ( 7 === $count ) {
  14. $class .= ' widget-sixths';
  15. } elseif ( 0 === $count % 2 ) {
  16. $class .= ' widget-halves uneven';
  17. } else {
  18. $class .= ' widget-halves';
  19. }
  20.  
  21. return $class;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement