Skip to content

Commit a3f0a36

Browse files
committed
Update Latest-Posts-Hover.php
1 parent 7b2a436 commit a3f0a36

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

widgets/Latest-Posts-Hover.php

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ protected function _register_controls()
314314
'type' => \Elementor\Controls_Manager::SWITCHER,
315315
'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
316316
'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
317-
'return_value' => 'block',
317+
'return_value' => 'inline-block',
318318
'default' => 'none',
319319
'selectors' => [
320320
'{{WRAPPER}} .tag' => 'display: {{VALUE}};',
@@ -915,7 +915,8 @@ protected function render()
915915
$args = [
916916
'posts_per_page' => $settings['posts_per_page'],
917917
];
918-
} else {
918+
}
919+
if(isset($_GET['category']) && (!$_GET['category']) == "all") {
919920
$args = [
920921
'posts_per_page' => $settings['posts_per_page'],
921922
'category_name' => isset($_GET['category']) ? sanitize_text_field($_GET['category']) : '',
@@ -985,10 +986,12 @@ protected function render()
985986
echo '
986987
<div class="info">
987988
<a class="title" href="' . $post_link . '">' . $post_title . ' <a/>';
988-
if ($tags) {
989+
if ($tags) {
990+
echo '<div class="categories-links">';
989991
foreach ($tags as $tag) {
990-
echo '<a href="' . get_tag_link($tag->term_id) . '" class="tag">' . $tag->name . '</a>';
991-
} } echo'
992+
echo '<a href="' . get_tag_link($tag->term_id) . '" class="tag">' . $tag->name . '</a> ';
993+
} echo '</div>';
994+
} echo'
992995
<p class="date">' . $post_date . '</p> ';
993996
if ($selected_page_id != 0) {
994997
$page_link = get_permalink($selected_page_id);
@@ -1040,11 +1043,15 @@ protected function render()
10401043
echo '
10411044
<div class="info">
10421045
<a class="title" href="' . $post_link . '">' . $post_title . ' <a/>';
1043-
if ($tags) {
1046+
if ($tags) {
1047+
echo '<div class="categories-links">';
10441048
foreach ($tags as $tag) {
10451049
echo '<a href="' . get_tag_link($tag->term_id) . '" class="tag">' . $tag->name . '</a>';
1046-
} } echo'
1047-
<p class="date">' . $post_date . '</p> ';
1050+
1051+
}
1052+
echo '</div>';
1053+
}
1054+
echo'<p class="date">' . $post_date . '</p> ';
10481055
if ($selected_page_id != 0) {
10491056
$page_link = get_permalink($selected_page_id);
10501057
$categories = get_the_category($post->ID);
@@ -1181,13 +1188,13 @@ protected function render()
11811188
11821189
}
11831190
.tag {
1184-
margin-top: 0;
1191+
margin-top: 0px;
11851192
margin-bottom: 0px;
11861193
padding: 0 5px;
11871194
font-size: 18px;
1188-
color: black;
1195+
color:black;
11891196
display:none;
1190-
text-align: left;
1197+
text-align: center;
11911198
}
11921199
.date {
11931200
margin-top: 0;

0 commit comments

Comments
 (0)