| @@ -109,8 +109,12 @@ | ||
| 109 | 109 | $block_post_wrap = $blockuniqueclass . ' blockspare-posts-block-post-wrap'; |
| 110 | 110 | $count = 0; |
| 111 | 111 | $layout_class = 'bs-flash-wrap flash-layout ' . $attributes['layoutStyle']; |
| 112 | 112 | |
| 113 | + if($attributes['fixedWidth']) { | |
| 114 | + $layout_class .= ' has-fixed-width'; | |
| 115 | + } | |
| 116 | + | |
| 113 | 117 | $exclusive_posts = 'bs-exclusive-posts blockspare-hover-item'; |
| 114 | 118 | if($attributes['border']){ |
| 115 | 119 | $exclusive_posts .= ' bs-border-enabled bs-' . $attributes['borderStyle']; |
| 116 | 120 | } else { |
| @@ -122,9 +126,9 @@ | ||
| 122 | 126 | }else{ |
| 123 | 127 | $flash_spiner_class .= $attributes['animationStyle']; |
| 124 | 128 | } |
| 125 | 129 | $spinner_icon = $attributes['spinnerIcon']; |
| 126 | - $marquee_class = 'marquee bs-flash-side ' . $attributes['direction']; | |
| 130 | + $marquee_class = 'bs-marquee bs-flash-side ' . $attributes['direction']; | |
| 127 | 131 | if($attributes['pauseOnHover']){ |
| 128 | 132 | $marquee_class .= ' pause-on-hover'; |
| 129 | 133 | } |
| 130 | 134 | ?> |
| @@ -129,29 +133,30 @@ | ||
| 129 | 133 | } |
| 130 | 134 | ?> |
| 131 | 135 | |
| 132 | 136 | <div class="<?php echo esc_attr($class);?> <?php echo esc_attr($attributes['blockHoverEffect']) ?>"> |
| 137 | +<?php echo latest_posts_style_control_flash($blockuniqueclass ,$attributes);?> | |
| 133 | 138 | <section class="<?php echo esc_attr($block_post_wrap);?>"> |
| 134 | 139 | <div class="<?php echo esc_attr($layout_class);?>"> |
| 135 | 140 | <div class="<?php echo esc_attr($exclusive_posts);?>"> |
| 136 | 141 | <div class="bs-exclusive-now"> |
| 137 | - <?php if($attributes['exclusiveSubtitle']){?> | |
| 138 | - <span class="bs-exclusive-news-title"><?php echo esc_html($attributes['exclusiveSubtitleText']); ?></span> | |
| 139 | - <?php }?> | |
| 142 | + <?php if($attributes['exclusiveSubtitle']){ ?> | |
| 143 | + <span class="bs-exclusive-news-title"><span><?php echo esc_html($attributes['exclusiveSubtitleText']); ?></span></span> | |
| 144 | + <?php } ?> | |
| 140 | 145 | <div class="bs-exclusive-now-txt-animation-wrap"> |
| 141 | - <?php if($attributes['spinner']){?> | |
| 146 | + <?php if($attributes['spinner']){ ?> | |
| 142 | 147 | <span class="<?php echo esc_attr($flash_spiner_class); ?>"> |
| 143 | - <?php if($attributes['spinnerOption'] == 'spinner-option-1') {?> | |
| 148 | + <?php if($attributes['spinnerOption'] == 'spinner-option-1') { ?> | |
| 144 | 149 | <div class="ring"></div> |
| 145 | 150 | <div class="ring"></div> |
| 146 | 151 | <div class="ring"></div> |
| 147 | 152 | <div class="ring"></div> |
| 148 | 153 | <div class="ring"></div> |
| 149 | - <?php } else {?> | |
| 154 | + <?php } else { ?> | |
| 150 | 155 | <i class="<?php echo esc_attr($spinner_icon);?>"></i> |
| 151 | - <?php }?> | |
| 156 | + <?php } ?> | |
| 152 | 157 | </span> |
| 153 | - <?php }?> | |
| 158 | + <?php } ?> | |
| 154 | 159 | <span class="bs-exclusive-texts-wrapper"> |
| 155 | 160 | <?php echo $attributes['exclusiveText'] != "" ? $attributes['exclusiveText'] : "Breaking News";?> |
| 156 | 161 | </span> |
| 157 | 162 | </div> |
| @@ -180,19 +185,19 @@ | ||
| 180 | 185 | <?php |
| 181 | 186 | |
| 182 | 187 | if (!empty($attributes['imageSize'])) { |
| 183 | 188 | $post_thumb_size = 'thumbnail '; |
| 184 | - }?> | |
| 189 | + } ?> | |
| 185 | 190 | <a href="<?php echo esc_url(get_permalink($post_id));?>" rel="bookmark" aria-hidden="true" |
| 186 | 191 | tabindex="-1"> |
| 187 | 192 | <span class="bs-circle-marq"> |
| 188 | - <?php if($attributes['enableCount']){?> | |
| 193 | + <?php if($attributes['enableCount']){ ?> | |
| 189 | 194 | <span class="bs-trending-no"><?php echo esc_html( $count );?></span> |
| 190 | - <?php }?> | |
| 195 | + <?php } ?> | |
| 191 | 196 | <?php |
| 192 | 197 | if(has_post_thumbnail($post_id)){ |
| 193 | 198 | echo wp_kses_post(wp_get_attachment_image($post_thumb_id, $post_thumb_size)); |
| 194 | - }else{?> | |
| 199 | + }else{ ?> | |
| 195 | 200 | <div class="bs-no-thumbnail-img"> </div> |
| 196 | 201 | <?php } ?> |
| 197 | 202 | </span> |
| 198 | 203 | <span class="bs-post-title"> |
| @@ -202,14 +207,14 @@ | ||
| 202 | 207 | if (!$title) { |
| 203 | 208 | $title = __('Untitled', 'blockspare'); |
| 204 | 209 | } |
| 205 | 210 | |
| 206 | - echo esc_html($title); | |
| 211 | + echo ($title); | |
| 207 | 212 | ?> |
| 208 | 213 | </span> |
| 209 | 214 | </a> |
| 210 | 215 | </h4> |
| 211 | - <?php }?> | |
| 216 | + <?php } ?> | |
| 212 | 217 | </div> |
| 213 | 218 | <div aria-hidden="true" class="bs-marquee-wrapper"> |
| 214 | 219 | <?php while ($grid_query->have_posts()) { |
| 215 | 220 | $grid_query->the_post(); |
| @@ -232,19 +237,19 @@ | ||
| 232 | 237 | <?php |
| 233 | 238 | |
| 234 | 239 | if (!empty($attributes['imageSize'])) { |
| 235 | 240 | $post_thumb_size = 'thumbnail '; |
| 236 | - }?> | |
| 241 | + } ?> | |
| 237 | 242 | <a href="<?php echo esc_url(get_permalink($post_id));?>" rel="bookmark" aria-hidden="true" |
| 238 | 243 | tabindex="-1"> |
| 239 | 244 | <span class="bs-circle-marq"> |
| 240 | - <?php if($attributes['enableCount']){?> | |
| 245 | + <?php if($attributes['enableCount']){ ?> | |
| 241 | 246 | <span class="bs-trending-no"><?php echo esc_html( $count );?></span> |
| 242 | - <?php }?> | |
| 247 | + <?php } ?> | |
| 243 | 248 | <?php |
| 244 | 249 | if(has_post_thumbnail($post_id)){ |
| 245 | 250 | echo wp_kses_post(wp_get_attachment_image($post_thumb_id, $post_thumb_size)); |
| 246 | - }else{?> | |
| 251 | + }else{ ?> | |
| 247 | 252 | <div class="bs-no-thumbnail-img"> </div> |
| 248 | 253 | <?php } ?> |
| 249 | 254 | </span> |
| 250 | 255 | <span class="bs-post-title"> |
| @@ -254,14 +259,14 @@ | ||
| 254 | 259 | if (!$title) { |
| 255 | 260 | $title = __('Untitled', 'blockspare'); |
| 256 | 261 | } |
| 257 | 262 | |
| 258 | - echo esc_html($title); | |
| 263 | + echo ($title); | |
| 259 | 264 | ?> |
| 260 | 265 | </span> |
| 261 | 266 | </a> |
| 262 | 267 | </h4> |
| 263 | - <?php }?> | |
| 268 | + <?php } ?> | |
| 264 | 269 | </div> |
| 265 | 270 | </div> |
| 266 | 271 | </div> |
| 267 | 272 | </div> |
| @@ -268,11 +273,10 @@ | ||
| 268 | 273 | </div> |
| 269 | 274 | </section> |
| 270 | 275 | </div> |
| 271 | 276 | <?php wp_reset_postdata(); |
| 272 | - $data_content = latest_posts_style_control_flash($blockuniqueclass ,$attributes); | |
| 273 | - $data_content .= ob_get_clean(); | |
| 274 | - return $data_content; | |
| 277 | + | |
| 278 | + return ob_get_clean(); | |
| 275 | 279 | } |
| 276 | 280 | } |
| 277 | 281 | } |
| 278 | 282 | |
| @@ -309,22 +313,16 @@ | ||
| 309 | 313 | |
| 310 | 314 | |
| 311 | 315 | |
| 312 | 316 | |
| 313 | - if(!function_exists('latest_posts_style_control_flash')){ | |
| 314 | - function latest_posts_style_control_flash($blockuniqueclass ,$attributes) | |
| 315 | - { | |
| 317 | +if(!function_exists('latest_posts_style_control_flash')){ | |
| 318 | + function latest_posts_style_control_flash($blockuniqueclass ,$attributes){ | |
| 316 | 319 | |
| 317 | 320 | $boxshadowcss = ''; |
| 318 | 321 | |
| 319 | - | |
| 320 | - | |
| 321 | - | |
| 322 | - | |
| 323 | 322 | $block_content = ''; |
| 324 | 323 | $block_content .= '<style type="text/css">'; |
| 325 | 324 | |
| 326 | - | |
| 327 | 325 | //post-flash-background |
| 328 | 326 | if($attributes['background']) { |
| 329 | 327 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{ |
| 330 | 328 | background-color:' . $attributes['backGroundColor'] . '; |
| @@ -331,11 +329,17 @@ | ||
| 331 | 329 | }'; |
| 332 | 330 | } |
| 333 | 331 | |
| 334 | 332 | //post-flash-border-radius |
| 335 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts, .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now-txt-animation-wrap, .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides{ | |
| 333 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{ | |
| 336 | 334 | border-radius:' . $attributes['borderRadius'] . 'px; |
| 337 | 335 | }'; |
| 336 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now-txt-animation-wrap{ | |
| 337 | + border-radius:' . $attributes['borderRadius'] . 'px; | |
| 338 | + }'; | |
| 339 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides{ | |
| 340 | + border-radius:' . $attributes['borderRadius'] . 'px; | |
| 341 | + }'; | |
| 338 | 342 | |
| 339 | 343 | //post-image-border-radius |
| 340 | 344 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-circle-marq{ |
| 341 | 345 | border-radius:' . $attributes['imgBorderRadius'] . 'px; |
| @@ -341,12 +345,17 @@ | ||
| 341 | 345 | border-radius:' . $attributes['imgBorderRadius'] . 'px; |
| 342 | 346 | }'; |
| 343 | 347 | |
| 344 | 348 | //post-flash-animation-speed |
| 345 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .marquee .bs-marquee-wrapper{ | |
| 349 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-marquee .bs-marquee-wrapper{ | |
| 346 | 350 | animation-duration:' . $attributes['animationSpeed'] . 's; |
| 347 | 351 | }'; |
| 348 | 352 | |
| 353 | + //post-widht | |
| 354 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.has-fixed-width h4.bs-post-title{ | |
| 355 | + width:' . $attributes['postWidth'] . 'px; | |
| 356 | + }'; | |
| 357 | + | |
| 349 | 358 | //Title color |
| 350 | 359 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ |
| 351 | 360 | color:' . $attributes['postTitleColor'] . '; |
| 352 | 361 | }'; |
| @@ -363,11 +372,14 @@ | ||
| 363 | 372 | }'; |
| 364 | 373 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-2 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{ |
| 365 | 374 | border-left-color:' . $attributes['newsBgColor'] . '; |
| 366 | 375 | }'; |
| 367 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-3 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after, .bs-flash-wrap.flash-style-4 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{ | |
| 376 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-3 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{ | |
| 368 | 377 | background-color:' . $attributes['newsBgColor'] . '; |
| 369 | 378 | }'; |
| 379 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-4 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{ | |
| 380 | + background-color:' . $attributes['newsBgColor'] . '; | |
| 381 | + }'; | |
| 370 | 382 | |
| 371 | 383 | //Border |
| 372 | 384 | if($attributes['border']) { |
| 373 | 385 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{ |
| @@ -395,8 +407,11 @@ | ||
| 395 | 407 | margin-top:' . $attributes['marginTop'] . 'px; |
| 396 | 408 | margin-right:' . $attributes['marginRight'] . 'px; |
| 397 | 409 | margin-bottom:' . $attributes['marginBottom'] . 'px; |
| 398 | 410 | margin-left:' . $attributes['marginLeft'] . 'px; |
| 411 | + }'; | |
| 412 | + | |
| 413 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-slides{ | |
| 399 | 414 | padding-top:' . $attributes['paddingTop'] . 'px; |
| 400 | 415 | padding-right:' . $attributes['paddingRight'] . 'px; |
| 401 | 416 | padding-bottom:' . $attributes['paddingBottom'] . 'px; |
| 402 | 417 | padding-left:' . $attributes['paddingLeft'] . 'px; |
| @@ -403,28 +418,33 @@ | ||
| 403 | 418 | }'; |
| 404 | 419 | |
| 405 | 420 | // Post Number Color |
| 406 | 421 | if($attributes['enableCount']){ |
| 407 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .marquee h4.bs-post-title a .bs-circle-marq .bs-trending-no{ | |
| 422 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-marquee h4.bs-post-title a .bs-circle-marq .bs-trending-no{ | |
| 408 | 423 | color: ' . $attributes['countColor'] . '; |
| 409 | 424 | }'; |
| 410 | 425 | } |
| 411 | 426 | |
| 412 | - | |
| 413 | - | |
| 414 | 427 | //Font Settings |
| 415 | 428 | |
| 416 | 429 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ |
| 417 | 430 | font-size: ' . $attributes['postTitleFontSize'] . $attributes['titleFontSizeType'] . '; |
| 418 | 431 | '.bscheckFontfamily($attributes['titleFontFamily']).'; |
| 419 | - font-weight: ' . $attributes['titleFontWeight'] . '; | |
| 432 | + '.bscheckFontfamilyWeight($attributes['titleFontWeight']).'; | |
| 433 | + line-height: ' . $attributes['postTitleLineHeight'] . '; | |
| 420 | 434 | }'; |
| 421 | 435 | |
| 422 | 436 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{ |
| 423 | 437 | font-size: ' . $attributes['exclusiveFontSize'] . $attributes['exclusiveFontSizeType'] . '; |
| 424 | 438 | '.bscheckFontfamily($attributes['exclusiveFontFamily']).'; |
| 425 | - font-weight: ' . $attributes['exclusiveFontWeight'] . '; | |
| 439 | + '.bscheckFontfamilyWeight($attributes['exclusiveFontWeight']).'; | |
| 426 | 440 | }'; |
| 441 | + | |
| 442 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{ | |
| 443 | + font-size: ' . $attributes['exclusiveSubtitleFontSize'] . $attributes['exclusiveSubtitleFontSizeType'] . '; | |
| 444 | + '.bscheckFontfamily($attributes['exclusiveSubtitleFontFamily']).'; | |
| 445 | + '.bscheckFontfamilyWeight($attributes['exclusiveSubtitleFontWeight']).'; | |
| 446 | + }'; | |
| 427 | 447 | |
| 428 | 448 | $block_content .= '@media (max-width: 1025px) { '; |
| 429 | 449 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ |
| 430 | 450 | font-size: ' . $attributes['titleFontSizeTablet'] . $attributes['titleFontSizeType'] . '; |
| @@ -431,8 +451,11 @@ | ||
| 431 | 451 | }'; |
| 432 | 452 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{ |
| 433 | 453 | font-size: ' . $attributes['exclusiveFontSizeTablet'] . $attributes['exclusiveFontSizeType'] . '; |
| 434 | 454 | }'; |
| 455 | + $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{ | |
| 456 | + font-size: ' . $attributes['exclusiveSubtitleFontSizeTablet'] . $attributes['exclusiveSubtitleFontSizeType'] . '; | |
| 457 | + }'; | |
| 435 | 458 | $block_content .= '}'; |
| 436 | 459 | |
| 437 | 460 | $block_content .= '@media (max-width: 767px) { '; |
| 438 | 461 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ |
| @@ -439,8 +462,10 @@ | ||
| 439 | 462 | font-size: ' . $attributes['titleFontSizeMobile'] . $attributes['titleFontSizeType'] . '; |
| 440 | 463 | }'; |
| 441 | 464 | $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{ |
| 442 | 465 | font-size: ' . $attributes['exclusiveFontSizeMobile'] . $attributes['exclusiveFontSizeType'] . '; |
| 466 | + }';$block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{ | |
| 467 | + font-size: ' . $attributes['exclusiveSubtitleFontSizeMobile'] . $attributes['exclusiveSubtitleFontSizeType'] . '; | |
| 443 | 468 | }'; |
| 444 | 469 | $block_content .= '}'; |
| 445 | 470 | |
| 446 | 471 | $block_content .= '</style>'; |