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-list/index.php +23 -19 1.1.21.2.1 View file →
@@ -41,11 +41,17 @@
41 41 $post_id = get_the_ID();
42 42
43 43 /* Setup the featured image ID */
44 44 $post_thumb_id = get_post_thumbnail_id($post_id);
45 +
46 + $has_img_class = '';
47 +
48 + if(!$post_thumb_id){
49 + $has_img_class = "post-has-no-image";
50 + }
45 51
46 52 /* Setup the post classes */
47 - $post_classes = 'blockspare-post-single';
53 + $post_classes = 'blockspare-post-single ';
48 54
49 55 /* Add sticky class */
50 56 if (is_sticky($post_id)) {
51 57 $post_classes .= ' sticky';
@@ -53,29 +59,23 @@
53 59 $post_classes .= null;
54 60 }
55 61
56 62 /* Join classes together */
57 - $post_classes = join(' ', get_post_class($post_classes, $post_id));
63 + //$post_classes = join(' ', get_post_class($post_classes, $post_id));
58 64
59 65
60 66 if ($attributes['enableBackgroundColor']) {
61 67 $post_classes .= 'has-background';
62 68 }
69 +
70 +
63 71
64 -
65 - $item_background_color = ($attributes['enableBackgroundColor']) ? esc_attr($attributes['backGroundColor']) : '';
66 -
67 - $bxshadow = 'none';
68 -
69 - if ($attributes['enableBoxShadow']) {
70 - $bxshadow = $attributes['xOffset'] . "px " . $attributes['yOffset'] . "px " . $attributes['blur'] . "px " . $attributes['spread'] . "px " . $attributes['shadowColor'];
71 - }
72 -
73 72 /* Start the markup for the post */
74 73 $blockspare_content_markup .= sprintf(
75 - '<article id="post-%1$s" class="%2$s" >',
74 + '<div id="post-%1$s" class="%2$s %3$s">',
76 75 esc_attr($post_id),
77 - esc_attr($post_classes)
76 + esc_attr($post_classes),
77 + $has_img_class
78 78
79 79
80 80 );
81 81
@@ -133,9 +133,9 @@
133 133 $post_title_tag = 'h4';
134 134 }
135 135
136 136 $blockspare_content_markup .= sprintf(
137 - '<%3$s class="blockspare-block-post-grid-title"><a href="%1$s" rel="bookmark">%2$s</a></%3$s>',
137 + '<%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>',
138 138 esc_url(get_permalink($post_id)),
139 139 esc_html($title),
140 140 esc_attr($post_title_tag)
141 141 );
@@ -245,11 +245,15 @@
245 245 /* Close the text content */
246 246 $blockspare_content_markup .= sprintf(
247 247 '</div>'
248 248 );
249 +
250 + $blockspare_content_markup .= sprintf(
251 + '</div>'
252 + );
249 253
250 254 /* Close the post */
251 - $blockspare_content_markup .= "</article>\n";
255 + $blockspare_content_markup .= "</div>\n";
252 256 }
253 257
254 258 /* Restore original post data */
255 259 wp_reset_postdata();
@@ -305,9 +309,9 @@
305 309
306 310 );
307 311
308 312 $block_content .= '<style type="text/css">';
309 - $block_content .= ' .' . $blockuniqueclass . ' .blockspare-post-wrap{
313 + $block_content .= ' .' . $blockuniqueclass . '.blockspare-latest-post-wrap{
310 314 margin-top:' . $attributes['marginTop'] . 'px;
311 315 margin-bottom:' . $attributes['marginBottom'] . 'px;
312 316 }';
313 317
@@ -314,17 +318,17 @@
314 318 $block_content .= ' .' . $blockuniqueclass . ' .blockspare-post-category{
315 319 color:' . $attributes['linkColor'] . ';
316 320 }';
317 321
318 - $block_content .= ' .' . $blockuniqueclass . ' .blockspare-block-post-grid-author a{
322 + $block_content .= ' .' . $blockuniqueclass . ' .blockspare-block-post-grid-author a span{
319 323 color:' . $attributes['linkColor'] . ';
320 324 }';
321 325
322 - $block_content .= ' .' . $blockuniqueclass . ' .blockspare-text-link a{
326 + $block_content .= ' .' . $blockuniqueclass . ' .blockspare-text-link a span{
323 327 color:' . $attributes['linkColor'] . ';
324 328 }';
325 329
326 - $block_content .= ' .' . $blockuniqueclass . ' .blockspare-block-post-grid-title a{
330 + $block_content .= ' .' . $blockuniqueclass . ' .blockspare-block-post-grid-title a span{
327 331 color: ' . $attributes['postTitleColor'] . ';
328 332 font-size: ' . $attributes['postTitleFontSize'] . $attributes['titleFontSizeType'] . ';
329 333 font-family: ' . $attributes['titleFontFamily'] . ';
330 334 font-weight: ' . $attributes['titleFontWeight'] . ';