| 1 |
<?php |
| 2 |
|
| 3 |
if(!function_exists('blockspare_carousel_render_block_core_latest_posts_list')){ |
| 4 |
function blockspare_carousel_render_block_core_latest_posts_list($attributes) |
| 5 |
{ |
| 6 |
|
| 7 |
ob_start(); |
| 8 |
$unq_class = mt_rand(100000,999999); |
| 9 |
$blockuniqueclass = ''; |
| 10 |
|
| 11 |
if(!empty($attributes['uniqueClass'])){ |
| 12 |
$blockuniqueclass = $attributes['uniqueClass']; |
| 13 |
}else{ |
| 14 |
$blockuniqueclass = 'blockspare-posts-block-list-'.$unq_class; |
| 15 |
} |
| 16 |
|
| 17 |
|
| 18 |
if ( isset( $attributes['categories'] ) && ! empty( $attributes['categories'] ) && is_array( $attributes['categories'] ) ) { |
| 19 |
$categories = array(); |
| 20 |
$i = 1; |
| 21 |
foreach ( $attributes['categories'] as $key => $value ) { |
| 22 |
$categories[] = $value['value']; |
| 23 |
} |
| 24 |
} else { |
| 25 |
$categories = array(); |
| 26 |
} |
| 27 |
|
| 28 |
if ( isset( $attributes['tags'] ) && ! empty( $attributes['tags'] ) && is_array( $attributes['tags'] ) ) { |
| 29 |
$tags = array(); |
| 30 |
$i = 1; |
| 31 |
foreach ( $attributes['tags'] as $key => $value ) { |
| 32 |
$tags[] = $value['value']; |
| 33 |
} |
| 34 |
} else { |
| 35 |
$tags = array(); |
| 36 |
} |
| 37 |
|
| 38 |
/* Setup the query */ |
| 39 |
|
| 40 |
$query_args = array( |
| 41 |
'posts_per_page' => $attributes['postsToShow'], |
| 42 |
'post_status' => 'publish', |
| 43 |
'order' => $attributes['order'], |
| 44 |
'orderby' => $attributes['orderBy'], |
| 45 |
'offset' => $attributes['offset'], |
| 46 |
'post_type' => $attributes['postType'], |
| 47 |
'ignore_sticky_posts' => 1, |
| 48 |
); |
| 49 |
|
| 50 |
if($attributes['taxType'] =='category'){ |
| 51 |
$query_args['category__in'] =$categories; |
| 52 |
|
| 53 |
} |
| 54 |
if($attributes['taxType'] =='post_tag'){ |
| 55 |
$query_args['tag__in'] =$tags; |
| 56 |
|
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
if($attributes['taxType'] !='category' && $attributes['taxType'] != 'post_tag'){ |
| 61 |
|
| 62 |
$tax_type = $attributes['taxType']; |
| 63 |
if ( $tax_type ) { |
| 64 |
$query_args['tax_query'][] = array( |
| 65 |
'taxonomy' => ( isset( $tax_type ) ) ? $tax_type : 'category', |
| 66 |
'field' => 'id', |
| 67 |
'terms' => $categories, |
| 68 |
'operator' => 'IN' , |
| 69 |
); |
| 70 |
} |
| 71 |
} |
| 72 |
|
| 73 |
$grid_query = new WP_Query($query_args); |
| 74 |
|
| 75 |
$next = $attributes['carouselNextIcon']; |
| 76 |
$prevstr = str_replace("-right", "-left",$attributes['carouselNextIcon']); |
| 77 |
|
| 78 |
$centermode = false; |
| 79 |
|
| 80 |
$responsivelayoutTab = 1; |
| 81 |
$responsivelayoutMobile = 1; |
| 82 |
|
| 83 |
|
| 84 |
if($attributes['numberofSlide']>2){ |
| 85 |
$responsivelayoutTab = 2; |
| 86 |
$responsivelayoutMobile =1; |
| 87 |
}else{ |
| 88 |
$responsivelayoutTab = $attributes['numberofSlide']; |
| 89 |
} |
| 90 |
|
| 91 |
|
| 92 |
$carousel_args = array( |
| 93 |
|
| 94 |
'dots'=>$attributes['showDots'], |
| 95 |
'loop'=>true, |
| 96 |
'autoplay'=> $attributes['enableAutoPlay'], |
| 97 |
'speed'=>$attributes['carouselSpeed'], |
| 98 |
'arrows'=>$attributes['showsliderNextPrev'], |
| 99 |
'slidesToShow'=> ($attributes['postListingOption'] ==='latest-posts-block-carousel-grid')?$attributes['numberofSlide']:1, |
| 100 |
'centerMode'=>$centermode, |
| 101 |
'responsive' => array( |
| 102 |
array( |
| 103 |
'breakpoint' => 769, |
| 104 |
'settings' => array( |
| 105 |
'slidesToShow' => $responsivelayoutTab, |
| 106 |
'slidesToScroll' => 1, |
| 107 |
'infinite' => true, |
| 108 |
'centerMode'=>false, |
| 109 |
), |
| 110 |
), |
| 111 |
// array( |
| 112 |
// 'breakpoint' => 600, |
| 113 |
// 'settings' => array( |
| 114 |
// 'slidesToShow' => $responsivelayoutTab, |
| 115 |
// 'slidesToScroll' => 1, |
| 116 |
// 'centerMode'=>false, |
| 117 |
// ), |
| 118 |
// ), |
| 119 |
array( |
| 120 |
'breakpoint' => 481, |
| 121 |
'settings' => array( |
| 122 |
'slidesToShow' => $responsivelayoutMobile, |
| 123 |
'slidesToScroll' => 1, |
| 124 |
'centerMode'=>false, |
| 125 |
), |
| 126 |
), |
| 127 |
), |
| 128 |
); |
| 129 |
$carousel_args_encoded = wp_json_encode($carousel_args); |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
/* Start the loop */ |
| 134 |
if ($grid_query->have_posts()) { |
| 135 |
$alignclass = blockspare_checkalignment($attributes['align']); |
| 136 |
/* Build the block classes */ |
| 137 |
$class = "wp-block-blockspare-posts-block-blockspare-posts-block-latest-posts blockspare-posts-block-post-wrap align".$alignclass; |
| 138 |
|
| 139 |
if (isset($attributes['className'])) { |
| 140 |
$class .= ' ' . $attributes['className']; |
| 141 |
} |
| 142 |
|
| 143 |
$list_layout_class = $attributes['grid']; |
| 144 |
|
| 145 |
|
| 146 |
$hoverNavClass =''; |
| 147 |
if($attributes['enableNavInHover']){ |
| 148 |
$hoverNavClass ='nav-on-hover'; |
| 149 |
} |
| 150 |
//$list_layout_class = $attributes['design']; |
| 151 |
$listgridClass = 'blockspare-posts-block-is-carousel' . " ".$attributes['navigationSize'].' '.$attributes['navigationShape'].' '.$hoverNavClass .' blockspare-slides-'.$attributes['numberofSlide']; |
| 152 |
|
| 153 |
|
| 154 |
/* Layout orientation class */ |
| 155 |
$grid_class = $blockuniqueclass . ' blockspare-posts-block-latest-post-carousel-wrap blockspare-posts-block-latest-post-wrap'.' ' . $listgridClass . ' ' . $list_layout_class. ' has-gutter-space-'.$attributes['gutterSpace']. " ".$attributes['postListingOption']; |
| 156 |
|
| 157 |
$category_class = 'blockspare-posts-block-post-category'; |
| 158 |
|
| 159 |
if($attributes['categoryLayoutOption'] =='none'){ |
| 160 |
$category_class .= ' has-no-category-style'; |
| 161 |
} |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
?> |
| 166 |
|
| 167 |
<section class="<?php echo esc_attr($class);?>"> |
| 168 |
<div class="<?php echo esc_attr($grid_class);?>"> |
| 169 |
<div class="latest-post-carousel" data-slick="<?php echo esc_attr($carousel_args_encoded); ?>" |
| 170 |
data-next="<?php echo esc_attr($next);?>" data-prev="<?php echo esc_attr($prevstr);?>"> |
| 171 |
<?php while ($grid_query->have_posts()) { |
| 172 |
$grid_query->the_post(); |
| 173 |
|
| 174 |
/* Setup the post ID */ |
| 175 |
$post_id = get_the_ID(); |
| 176 |
|
| 177 |
/* Setup the featured image ID */ |
| 178 |
$post_thumb_id = get_post_thumbnail_id($post_id); |
| 179 |
|
| 180 |
$has_img_class = ''; |
| 181 |
|
| 182 |
if (!$post_thumb_id) { |
| 183 |
$has_img_class = "post-has-no-image"; |
| 184 |
} |
| 185 |
|
| 186 |
$contentOrderClass =''; |
| 187 |
if($attributes['contentOrder']=='content-order-1'){ |
| 188 |
$contentOrderClass .= 'contentorderone'; |
| 189 |
} |
| 190 |
if( $attributes['contentOrder']=='content-order-2'){ |
| 191 |
$contentOrderClass .= 'contentordertwo'; |
| 192 |
} |
| 193 |
|
| 194 |
|
| 195 |
/* Setup the post classes */ |
| 196 |
$post_classes = 'blockspare-posts-block-post-single '. $contentOrderClass; |
| 197 |
if($attributes['enableEqualHeight']){ |
| 198 |
$post_classes .= ' bs-has-equal-height'; |
| 199 |
} |
| 200 |
|
| 201 |
/* Add sticky class */ |
| 202 |
if (is_sticky($post_id)) { |
| 203 |
$post_classes .= ' sticky'; |
| 204 |
} else { |
| 205 |
$post_classes .= null; |
| 206 |
}?> |
| 207 |
<div id="<?php echo esc_attr($post_id);?>" class="<?php echo esc_attr($post_classes).' '.$has_img_class; ?>"> |
| 208 |
<?php blockspare_post_image($attributes,$post_id,$category_class);?> |
| 209 |
<?php blockspare_post_content($attributes,$post_id,$category_class);?> |
| 210 |
</div> |
| 211 |
|
| 212 |
|
| 213 |
<?php }?> |
| 214 |
</div> |
| 215 |
</div> |
| 216 |
</section> |
| 217 |
<?php wp_reset_postdata(); |
| 218 |
$data_content = latest_posts_style_control_carousel($blockuniqueclass ,$attributes); |
| 219 |
$data_content .= ob_get_clean(); |
| 220 |
return $data_content; |
| 221 |
} |
| 222 |
} |
| 223 |
} |
| 224 |
|
| 225 |
/** |
| 226 |
* Registers the post grid block on server |
| 227 |
*/ |
| 228 |
if(!function_exists('blockspare_carousel_register_block_core_latest_posts_list')){ |
| 229 |
function blockspare_carousel_register_block_core_latest_posts_list() |
| 230 |
{ |
| 231 |
|
| 232 |
if (!function_exists('register_block_type')) { |
| 233 |
return; |
| 234 |
} |
| 235 |
|
| 236 |
|
| 237 |
ob_start(); |
| 238 |
include BLOCKSPARE_PLUGIN_DIR . 'src/blocks/latest-posts-carousel-grid/block.json'; |
| 239 |
|
| 240 |
$metadata = json_decode(ob_get_clean(), true); |
| 241 |
|
| 242 |
/* Block attributes */ |
| 243 |
register_block_type( |
| 244 |
'blockspare/latest-posts-block-carousel-grid', |
| 245 |
array( |
| 246 |
'attributes' =>$metadata['attributes'], |
| 247 |
'render_callback' => 'blockspare_carousel_render_block_core_latest_posts_list', |
| 248 |
) |
| 249 |
); |
| 250 |
} |
| 251 |
|
| 252 |
add_action('init', 'blockspare_carousel_register_block_core_latest_posts_list'); |
| 253 |
} |
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
if(!function_exists('latest_posts_style_control_carousel')){ |
| 258 |
function latest_posts_style_control_carousel($blockuniqueclass ,$attributes) |
| 259 |
{ |
| 260 |
|
| 261 |
|
| 262 |
$block_content = ''; |
| 263 |
$block_content .= '<style type="text/css">'; |
| 264 |
$block_content .= ' .' . $blockuniqueclass . '.blockspare-posts-block-latest-post-carousel-wrap{ |
| 265 |
margin-top:' . $attributes['marginTop'] . 'px; |
| 266 |
margin-bottom:' . $attributes['marginBottom'] . 'px; |
| 267 |
}'; |
| 268 |
|
| 269 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-content{ |
| 270 |
padding-top:' . $attributes['contentPaddingTop'] . 'px; |
| 271 |
padding-right:' . $attributes['contentPaddingRight'] . 'px; |
| 272 |
padding-bottom:' . $attributes['contentPaddingBottom'] . 'px; |
| 273 |
padding-left:' . $attributes['contentPaddingLeft'] . 'px; |
| 274 |
}'; |
| 275 |
|
| 276 |
|
| 277 |
if ($attributes['categoryLayoutOption'] == 'solid') { |
| 278 |
|
| 279 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a{ |
| 280 |
color:' . $attributes['categoryTextColor'] . "!important" . '; |
| 281 |
background-color:' . $attributes['categoryBackgroundColor'] . "!important" . '; |
| 282 |
border-radius:' . $attributes['categoryBorderRadius'] . "px" . '; |
| 283 |
}'; |
| 284 |
|
| 285 |
} else if ($attributes['categoryLayoutOption'] == 'border') { |
| 286 |
|
| 287 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a{ |
| 288 |
color:' . $attributes['categoryTextColor'] . "!important" . '; |
| 289 |
background-color:' . "transparent" . '; |
| 290 |
border:' . "1px solid" . $attributes['categoryBorderColor'] . '; |
| 291 |
border-radius:' . $attributes['categoryBorderRadius'] . "px" . '; |
| 292 |
border-width:' . $attributes['categoryBorderWidth'] . "px" . '; |
| 293 |
}'; |
| 294 |
|
| 295 |
} else { |
| 296 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category a{ |
| 297 |
color:' . $attributes['categoryTextColor'] . "!important" . '; |
| 298 |
}'; |
| 299 |
} |
| 300 |
|
| 301 |
|
| 302 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-category{ |
| 303 |
margin-top:' . $attributes['categoryMarginTop'] . 'px' . '; |
| 304 |
margin-bottom:' . $attributes['categoryMarginBottom'] . 'px' . '; |
| 305 |
}'; |
| 306 |
|
| 307 |
|
| 308 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-byline{ |
| 309 |
|
| 310 |
margin-top:' . $attributes['metaMarginTop'] . 'px' . '; |
| 311 |
margin-bottom:' . $attributes['metaMarginBottom'] . 'px' . '; |
| 312 |
}'; |
| 313 |
|
| 314 |
|
| 315 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-more-link{ |
| 316 |
margin-top:' . $attributes['moreLinkMarginTop'] . 'px' . '; |
| 317 |
margin-bottom:' . $attributes['moreLinkMarginBottom'] . 'px' . '; |
| 318 |
}'; |
| 319 |
|
| 320 |
$block_content .= ' .' . $blockuniqueclass . '.blockspare-posts-block-is-carousel span:before, .blockspare-posts-block-latest-post-carousel-wrap ul li button{ |
| 321 |
color:' . $attributes['navigationColor'] . '; |
| 322 |
}'; |
| 323 |
|
| 324 |
$block_content .= ' .' . $blockuniqueclass . '.blockspare-posts-block-is-carousel .slick-slider .slick-dots > li button{ |
| 325 |
background-color:'. $attributes['navigationColor']. '; |
| 326 |
}'; |
| 327 |
|
| 328 |
if($attributes['navigationShape'] == 'lpc-navigation-1' || $attributes['navigationShape'] == 'lpc-navigation-2'){ |
| 329 |
$block_content .= ' .' . $blockuniqueclass . '.blockspare-posts-block-is-carousel .slick-slider .slick-arrow:after{ |
| 330 |
background-color:'. $attributes['navigationShapeColor']. ' |
| 331 |
}'; |
| 332 |
}elseif($attributes['navigationShape'] == 'lpc-navigation-3' || $attributes['navigationShape'] == 'lpc-navigation-4'){ |
| 333 |
$block_content .= ' .' . $blockuniqueclass . '.blockspare-posts-block-is-carousel .slick-slider .slick-arrow{ |
| 334 |
border-color:'. $attributes['navigationShapeColor']. ' |
| 335 |
}'; |
| 336 |
}else{ |
| 337 |
$block_content .= ' .' . $blockuniqueclass . '.blockspare-posts-block-is-carousel .slick-slider .slick-arrow{ |
| 338 |
border-color:transparent ; |
| 339 |
background-color:transparent |
| 340 |
}'; |
| 341 |
|
| 342 |
} |
| 343 |
|
| 344 |
//Title Hover |
| 345 |
|
| 346 |
if($attributes['titleOnHover']=='lpc-title-hover') { |
| 347 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-content .blockspare-posts-block-title-link:hover span{ |
| 348 |
color: ' . $attributes['titleOnHoverColor'] . '; |
| 349 |
|
| 350 |
}'; |
| 351 |
} |
| 352 |
|
| 353 |
if($attributes['titleOnHover']=='lpc-title-border') { |
| 354 |
$block_content .= ' .' . $blockuniqueclass . ' .lpc-title-border .blockspare-posts-block-post-grid-title .blockspare-posts-block-title-link span:hover{ |
| 355 |
box-shadow: inset 0 -2px 0 0 ' . $attributes['titleOnHoverColor'] . '; |
| 356 |
|
| 357 |
}'; |
| 358 |
} |
| 359 |
|
| 360 |
//Content Bakcground |
| 361 |
|
| 362 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-title a span{ |
| 363 |
color: ' . $attributes['postTitleColor'] . '; |
| 364 |
|
| 365 |
}'; |
| 366 |
|
| 367 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-author a span{ |
| 368 |
color:' . $attributes['linkColor'] . '; |
| 369 |
}'; |
| 370 |
|
| 371 |
|
| 372 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-more-link span{ |
| 373 |
color:' . $attributes['linkColor'] . '; |
| 374 |
}'; |
| 375 |
|
| 376 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-date{ |
| 377 |
color:' . $attributes['generalColor'] . '; |
| 378 |
}'; |
| 379 |
|
| 380 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-excerpt-content,' . ' .' . $blockuniqueclass . ' .comment_count{ |
| 381 |
color:' . $attributes['generalColor'] . '; |
| 382 |
|
| 383 |
}'; |
| 384 |
|
| 385 |
|
| 386 |
//end Content Background |
| 387 |
|
| 388 |
|
| 389 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-title{ |
| 390 |
margin-top:' . $attributes['titleMarginTop'] . 'px' . '; |
| 391 |
margin-bottom:' . $attributes['titleMarginBottom'] . 'px' . '; |
| 392 |
}'; |
| 393 |
|
| 394 |
|
| 395 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-excerpt-content{ |
| 396 |
margin-top:' . $attributes['exceprtMarginTop'] . 'px' . '; |
| 397 |
margin-bottom:' . $attributes['exceprtMarginBottom'] . 'px' . '; |
| 398 |
}'; |
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
$boxshadow= false; |
| 404 |
|
| 405 |
if(!empty($attributes['grid']) && isset($attributes['grid'])){ |
| 406 |
if($attributes['grid']=='blockspare-posts-block-grid-layout-1' || $attributes['grid']=='blockspare-posts-block-grid-layout-2' || $attributes['grid']=='blockspare-posts-block-grid-layout-5' || $attributes['grid']=='blockspare-posts-block-grid-layout-6' || $attributes['grid']=='blockspare-posts-block-grid-layout-9' || $attributes['grid']=='blockspare-posts-block-grid-layout-10' || $attributes['grid']=='blockspare-posts-block-grid-layout-13' || $attributes['grid']=='blockspare-posts-block-grid-layout-14'){ |
| 407 |
$boxshadow = true; |
| 408 |
} |
| 409 |
} |
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
|
| 416 |
if($boxshadow) { |
| 417 |
if($attributes['enableBoxShadow']) { |
| 418 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-single{ |
| 419 |
box-shadow: ' . $attributes['xOffset'] . 'px ' . $attributes['yOffset'] . 'px ' . $attributes['blur'] . 'px ' . $attributes['spread'] . 'px ' . $attributes['shadowColor'] . '; |
| 420 |
border-radius:' . $attributes['borderRadius'] . 'px' . '; |
| 421 |
}'; |
| 422 |
}else{ |
| 423 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-single{ |
| 424 |
border-radius:' . $attributes['borderRadius'] . 'px' . '; |
| 425 |
}'; |
| 426 |
} |
| 427 |
}else{ |
| 428 |
if($attributes['enableBoxShadow']){ |
| 429 |
$block_content .= ' .' . $blockuniqueclass . '.blockspare-posts-block-latest-post-carousel-wrap .blockspare-posts-block-post-single .blockspare-posts-block-post-img img{ |
| 430 |
box-shadow: ' . $attributes['xOffset'] . 'px ' . $attributes['yOffset'] . 'px ' . $attributes['blur'] . 'px ' . $attributes['spread'] . 'px ' . $attributes['shadowColor'] . '; |
| 431 |
border-radius:' . $attributes['borderRadius'] . 'px' . '; |
| 432 |
}'; |
| 433 |
}else{ |
| 434 |
$block_content .= ' .' . $blockuniqueclass . '.blockspare-posts-block-latest-post-carousel-wrap .blockspare-posts-block-post-single .blockspare-posts-block-post-img img{ |
| 435 |
border-radius:' . $attributes['borderRadius'] . 'px' . '; |
| 436 |
}'; |
| 437 |
} |
| 438 |
|
| 439 |
} |
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
if ($attributes['grid'] != 'blockspare-posts-block-grid-layout-3' && $attributes['grid'] != 'blockspare-posts-block-grid-layout-4' && $attributes['grid'] != 'blockspare-posts-block-grid-layout-7'&& $attributes['grid'] != 'blockspare-posts-block-grid-layout-8' && $attributes['grid'] != 'blockspare-posts-block-grid-layout-11' && $attributes['grid'] != 'blockspare-posts-block-grid-layout-12') { |
| 445 |
|
| 446 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-single{ |
| 447 |
background-color:' . $attributes['backGroundColor'] . '; |
| 448 |
}'; |
| 449 |
} |
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
//Font Settings |
| 455 |
|
| 456 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-title a span{ |
| 457 |
|
| 458 |
font-size: ' . $attributes['postTitleFontSize'] . $attributes['titleFontSizeType'] . '; |
| 459 |
'.bscheckFontfamily($attributes['titleFontFamily']).'; |
| 460 |
font-weight: ' . $attributes['titleFontWeight'] . '; |
| 461 |
|
| 462 |
}'; |
| 463 |
|
| 464 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-title{ |
| 465 |
|
| 466 |
line-height:' .$attributes['lineHeight'].'; |
| 467 |
}'; |
| 468 |
|
| 469 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-content .blockspare-posts-block-post-grid-excerpt .blockspare-posts-block-post-grid-excerpt-content{ |
| 470 |
font-size:' . $attributes['descriptionFontSize'] . $attributes['descriptionFontSizeType'] . '; |
| 471 |
'.bscheckFontfamily($attributes['descriptionFontFamily']).'; |
| 472 |
font-weight: ' . $attributes['descriptionFontWeight'] . '; |
| 473 |
}'; |
| 474 |
|
| 475 |
$block_content .= '@media (max-width: 1025px) { '; |
| 476 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-title a span{ |
| 477 |
font-size: ' . $attributes['titleFontSizeTablet'] . $attributes['titleFontSizeType'] . '; |
| 478 |
}'; |
| 479 |
$block_content .= ' .' . $blockuniqueclass .' .blockspare-posts-block-post-content .blockspare-posts-block-post-grid-excerpt{ |
| 480 |
font-size:' . $attributes['descriptionFontSizeTablet'].$attributes['descriptionFontSizeType'].' |
| 481 |
}'; |
| 482 |
$block_content .= '}'; |
| 483 |
|
| 484 |
|
| 485 |
$block_content .= '@media (max-width: 767px) { '; |
| 486 |
$block_content .= ' .' . $blockuniqueclass . ' .blockspare-posts-block-post-grid-title a span{ |
| 487 |
font-size: ' . $attributes['titleFontSizeMobile'] . $attributes['titleFontSizeType'] . '; |
| 488 |
}'; |
| 489 |
$block_content .= ' .' . $blockuniqueclass .' .blockspare-posts-block-post-content .blockspare-posts-block-post-grid-excerpt{ |
| 490 |
font-size:' . $attributes['descriptionFontSizeMobile'].$attributes['descriptionFontSizeType'].' |
| 491 |
}'; |
| 492 |
$block_content .= '}'; |
| 493 |
|
| 494 |
$block_content .= '</style>'; |
| 495 |
return $block_content; |
| 496 |
} |
| 497 |
} |
| 498 |
|