PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / 1.2.1
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites v1.2.1
4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 2.6.1 All 38 releases
← All changes | src/blocks/latest-posts-grid/index.php +17 -20 1.1.21.2.1 View file →
@@ -44,8 +44,15 @@
44 44 $post_id = get_the_ID();
45 45
46 46 /* Setup the featured image ID */
47 47 $post_thumb_id = get_post_thumbnail_id($post_id);
48 +
49 + $has_img_class = '';
50 +
51 + if(!$post_thumb_id){
52 + $has_img_class = "post-has-no-image";
53 + }
54 +
48 55
49 56 /* Setup the post classes */
50 57 $post_classes = 'blockspare-post-single';
51 58
@@ -59,33 +66,23 @@
59 66
60 67 if ($attributes['enableBackgroundColor']) {
61 68 $post_classes .= ' has-background';
62 69 }
70 +
63 71
64 -
65 - $bxshadow = '';
66 -
67 - if ($attributes['enableBoxShadow']) {
68 - $bxshadow = $attributes['xOffset'] . "px " . $attributes['yOffset'] . "px " . $attributes['blur'] . "px " . $attributes['spread'] . "px " . $attributes['shadowColor'];
69 - }
70 -
71 72 if ($attributes['equalImageHeight']) {
72 73 $post_classes .= ' has-img-equal-height';
73 74 } else {
74 75 $post_classes .= '';
75 76 }
76 - /* Join classes together */
77 - $post_classes = join(' ', get_post_class($post_classes, $post_id));
78 -
79 -
80 - $item_background_color = ($attributes['enableBackgroundColor']) ? esc_attr($attributes['backGroundColor']) : '';
81 77
82 78
83 79 /* Start the markup for the post */
84 80 $blockspare_content_markup .= sprintf(
85 - '<article id="post-%1$s" class="%2$s">',
81 + '<div id="post-%1$s" class="%2$s %3$s">',
86 82 esc_attr($post_id),
87 - esc_attr($post_classes)
83 + esc_attr($post_classes),
84 + $has_img_class
88 85
89 86
90 87 );
91 88
@@ -150,9 +147,9 @@
150 147 $post_title_tag = 'h4';
151 148 }
152 149
153 150 $blockspare_content_markup .= sprintf(
154 - '<%3$s class="blockspare-block-post-grid-title" ><a href="%1$s" rel="bookmark">%2$s</a></%3$s>',
151 + '<%3$s class="blockspare-block-post-grid-title" ><a href="%1$s" class="blockspare-title-link" rel="bookmark"><span>%2$s</span></a></%3$s>',
155 152 esc_url(get_permalink($post_id)),
156 153 esc_html($title),
157 154 esc_attr($post_title_tag)
158 155 );
@@ -261,9 +258,9 @@
261 258 '</div>'
262 259 );
263 260
264 261 /* Close the post */
265 - $blockspare_content_markup .= "</article>\n";
262 + $blockspare_content_markup .= "</div>\n";
266 263 }
267 264
268 265 /* Restore original post data */
269 266 wp_reset_postdata();
@@ -314,9 +311,9 @@
314 311 );
315 312
316 313
317 314 $block_content .= '<style type="text/css">';
318 - $block_content .= ' .' . $blockuniqueclass . ' .blockspare-post-wrap{
315 + $block_content .= ' .' . $blockuniqueclass . '.blockspare-latest-post-wrap{
319 316 margin-top:' . $attributes['marginTop'] . 'px;
320 317 margin-bottom:' . $attributes['marginBottom'] . 'px;
321 318 }';
322 319
@@ -323,17 +320,17 @@
323 320 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-post-category{
324 321 color:' . $attributes['linkColor'] . ';
325 322 }';
326 323
327 - $block_content .= ' .' . $blockuniqueclass . ' .blockspare-block-post-grid-author a{
324 + $block_content .= ' .' . $blockuniqueclass . ' .blockspare-block-post-grid-author a span{
328 325 color:' . $attributes['linkColor'] . ';
329 326 }';
330 327
331 - $block_content .= ' .' . $blockuniqueclass . ' .blockspare-text-link a{
328 + $block_content .= ' .' . $blockuniqueclass . ' .blockspare-text-link a span{
332 329 color:' . $attributes['linkColor'] . ';
333 330 }';
334 331
335 - $block_content .= ' .' . $blockuniqueclass . ' .blockspare-block-post-grid-title a{
332 + $block_content .= ' .' . $blockuniqueclass . ' .blockspare-block-post-grid-title a span{
336 333 color: ' . $attributes['postTitleColor'] . ';
337 334 font-size: ' . $attributes['postTitleFontSize'] . $attributes['titleFontSizeType'] . ';
338 335 font-family: ' . $attributes['titleFontFamily'] . ';
339 336 font-weight: ' . $attributes['titleFontWeight'] . ';