Example #1
0
 protected function spanClass($grid_columns_count)
 {
     $teaser_width = '';
     switch ($grid_columns_count) {
         case '1':
             $teaser_width = 'vc_span12';
             break;
         case '2':
             $teaser_width = 'vc_span6';
             break;
         case '3':
             $teaser_width = 'vc_span4';
             break;
         case '4':
             $teaser_width = 'vc_span3';
             break;
         case '5':
             $teaser_width = 'vc_span10';
             break;
         case '6':
             $teaser_width = 'vc_span2';
             break;
     }
     //return $teaser_width;
     $custom = get_custom_column_class($teaser_width);
     return $custom ? $custom : $teaser_width;
 }
Example #2
0
function wpb_translateColumnWidthToSpan( $width, $front = true ) {
	if ( preg_match( '/^(\d{1,2})\/12$/', $width, $match ) ) {
		$w = "span" . $match[1];
	} else {
		switch ( $width ) {
			case "1/6" :
				$w = "span2";
				break;
			case "1/4" :
				$w = "span3";
				break;
			case "1/3" :
				$w = "span4";
				break;
			case "1/2" :
				$w = "span6";
				break;
			case "2/3" :
				$w = "span8";
				break;
			case "3/4" :
				$w = "span9";
				break;
			case "5/6" :
				$w = "span10";
				break;
			case "1/1" :
				$w = "span12";
				break;
			default :
				$w = $width;
		}
	}
	$custom = $front ? get_custom_column_class( $w ) : false;
	return $custom ? $custom : 'vc_' . $w;
}
Example #3
0
function wpb_translateColumnWidthToSpan($width, $front = true)
{
    if (preg_match('/^(\\d{1,2})\\/12$/', $width, $match)) {
        $w = 'vc_col-sm-' . $match[1];
    } else {
        $w = 'vc_col-sm-';
        switch ($width) {
            case "1/6":
                $w .= '2';
                break;
            case "1/4":
                $w .= '3';
                break;
            case "1/3":
                $w .= '4';
                break;
            case "1/2":
                $w .= '6';
                break;
            case "2/3":
                $w .= '8';
                break;
            case "3/4":
                $w .= '9';
                break;
            case "5/6":
                $w .= '10';
                break;
            case "1/1":
                $w .= '12';
                break;
            default:
                $w = $width;
        }
    }
    $custom = $front ? get_custom_column_class($w) : false;
    return $custom ? $custom : $w;
}
Example #4
0
function wpb_translateColumnWidthToSpan($width, $front = true)
{
    switch ($width) {
        case "1/12":
            $w = "span1";
            break;
        case "1/6":
            $w = "span2";
            break;
        case "1/4":
            $w = "span3";
            break;
        case "1/3":
            $w = "span4";
            break;
        case "5/12":
            $w = "span5";
            break;
        case "1/2":
            $w = "span6";
            break;
        case "7/12":
            $w = "span7";
            break;
        case "2/3":
            $w = "span8";
            break;
        case "3/4":
            $w = "span9";
            break;
        case "5/6":
            $w = "span10";
            break;
        case "11/12":
            $w = "span11";
            break;
        case "1/1":
            $w = "span12";
            break;
        default:
            $w = $width;
    }
    $custom = $front ? get_custom_column_class($w) : false;
    return $custom ? $custom : 'vc_' . $w;
}
Example #5
0
/**
 * @param $width
 * @param bool $front
 *
 * @since 4.2
 * @return bool|string
 */
function wpb_translateColumnWidthToSpan($width, $front = true)
{
    preg_match('/(\\d+)\\/(\\d+)/', $width, $matches);
    $w = $width;
    if (!empty($matches)) {
        $part_x = (int) $matches[1];
        $part_y = (int) $matches[2];
        if ($part_x > 0 && $part_y > 0) {
            $value = ceil($part_x / $part_y * 12);
            if ($value > 0 && $value <= 12) {
                $w = 'vc_col-sm-' . $value;
            }
        }
    }
    $custom = $front ? get_custom_column_class($w) : false;
    return $custom ? $custom : $w;
}
Example #6
0
 function et_translateColumnsCountToSpanClass($grid_columns_count)
 {
     $teaser_width = '';
     switch ($grid_columns_count) {
         case '1':
             $teaser_width = 'et_col12';
             break;
         case '2':
             $teaser_width = 'et_col6';
             break;
         case '3':
             $teaser_width = 'et_col4';
             break;
         case '4':
             $teaser_width = 'et_col3';
             break;
         case '6':
             $teaser_width = 'et_col2';
             break;
     }
     //return $teaser_width;
     $custom = get_custom_column_class($teaser_width);
     return $custom ? $custom : $teaser_width;
 }