'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo '
'; echo ''; } if( $enabled && $trigger == 'button' ) { echo ''; echo ' '. __( 'Load More', 'agama' ); echo ''; } } /** * Generate Footer Widgets Bootstrap Class * * @since 1.2.9 */ public static function get_fwidgets_bs_class() { $count = 0; if( is_active_sidebar( 'footer-widget-1' ) ) { $count++; } if( is_active_sidebar( 'footer-widget-2' ) ) { $count++; } if( is_active_sidebar( 'footer-widget-3' ) ) { $count++; } if( is_active_sidebar( 'footer-widget-4' ) ) { $count++; } switch( $count ) { case '1': echo esc_attr( 'tv-col-md-12' ); break; case '2': echo esc_attr( 'tv-col-md-6' ); break; case '3': echo esc_attr( 'tv-col-md-4' ); break; case '4': echo esc_attr( 'tv-col-md-6 tv-col-lg-3' ); break; } } /** * Convert hexdec color string to rgb(a) string. * * @since 1.2.9 */ public static function hex2rgba( $color, $opacity = false ) { $default = 'rgb(0,0,0)'; //Return default if no color provided if( empty( $color ) ) return $default; //Sanitize $color if "#" is provided if( $color[0] == '#' ) { $color = substr( $color, 1 ); } //Check if color has 6 or 3 characters and get values if( strlen( $color ) == 6) { $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] ); } elseif( strlen( $color ) == 3 ) { $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] ); } else { return $default; } // Convert hexadec to rgb $rgb = array_map( 'hexdec', $hex ); //Check if opacity is set(rgba or rgb) if( $opacity ){ if( abs( $opacity ) > 1) $opacity = 1.0; $output = 'rgba('. implode(",",$rgb) .','. $opacity .')'; } else { $output = 'rgb('. implode(",",$rgb) .')'; } //Return rgb(a) color string return $output; } } /* Omit closing PHP tag to avoid "Headers already sent" issues. */