';
+ $selected_page_id = $settings['selected_page'];
+
+ foreach ($posts as $post) {
+ $post_title = get_the_title($post->ID);
+ if (wp_is_mobile()) {
+ $post_content = wp_trim_words($post->post_content, $wordMobile);
+ } else {
+ $post_content = wp_trim_words($post->post_content, $wordPc);
+ }
+ $post_date = get_the_date('j F Y', $post->ID);
+ $post_link = get_permalink($post->ID);
+ $tags = get_the_tags($post->ID);
+ $post_numb = get_the_date('Y-m-d', $post->ID);
+ $date_array = explode('-', $post_numb);
+ // Check if the post has a featured image
+ $featured_image = get_the_post_thumbnail_url($post->ID);
+ if (!$featured_image) {
+ // If not, use the custom default image
+ $featured_image = $settings['default_image']['url'];
+ }
+ if (is_admin()) {
+ echo '
';
+ } else {
+ if (wp_is_mobile()) {
+ echo '
';
+ } else {
+ echo '
';
+ }
+ }
+ echo '
+
+
' . $post_title . ' ';
+ if (!empty($tags)) {
+ if ($selected_page_id != 0) {
+ $page_link = get_permalink($selected_page_id);
+ foreach ($tags as $tag) {
+ $tag_link = add_query_arg('tags', $tag->slug, $page_link);
+ echo '
' . $tag->name . ' ';
+ }
+ } else {
+ foreach ($tags as $tag) {
+
+ echo '
' . $tag->name . ' ';
+ }
+ }
+ }
+ $date_parts = explode(' ', $post_date);
+ $i = 2;
+ $date_array[1] = $date_array[0] . '/' . $date_array[1];
+ $date_array[2] = $date_array[1] . '/' . $date_array[2];
+ if ($selected_page_id != 0) {
+ $page_link = get_permalink($selected_page_id);
+ echo '
';
+ foreach ($date_parts as $part) {
+ if ($i == 1) {
+ $date_array[1] = $date_array[1] . '/01';
+ }
+ $date_link = add_query_arg('date', $date_array[$i], $page_link);
+ echo '
' . ucfirst($part) . '';
+ $i -= 1;
+ }
+ echo '
';
+ } else {
+ echo '
';
+ $i = 2;
+ foreach ($date_parts as $part) {
+ $date_link = home_url() . '/' . $date_array[$i];
+ echo '
' . ucfirst($part) . '';
+ $i -= 1;
+ }
+ echo '
';
+ }
+ if ($selected_page_id != 0) {
+ $page_link = get_permalink($selected_page_id);
+ $categories = get_the_category($post->ID);
+ if (!empty($categories)) {
+ foreach ($categories as $category) {
+ $category_link = add_query_arg('category', $category->slug, $page_link);
+ echo '
' . $category->name . ' ';
+ }
+ }
+ } else {
+ $categories = get_the_category($post->ID);
+ if (!empty($categories)) {
+ foreach ($categories as $category) {
+ echo '
' . $category->name . ' ';
+ }
+ }
+ }
+ echo '
' . $post_content . '
+
+
';
+ }
+ wp_reset_postdata();
+ echo '
';
+>>>>>>> fb75035c574edd38fcbb371b94878f49a8b99ba1
+ if (!$posts) {
+ // Gestisci il caso in cui $posts non è un array valido
+ echo '
';
+ echo esc_html__('No post', 'Latest-Posts-Hover');
+ echo '
';
+ }
+ echo '';
+ }
+}
+=======
+
+ ';
+ }
+}
+ }
+ }
+>>>>>>> fb75035c574edd38fcbb371b94878f49a8b99ba1
From 2497838ffc261ae3d3546d568267b5c6d5ba1183 Mon Sep 17 00:00:00 2001
From: Daddie2 <50950554+Daddie2@users.noreply.github.com>
Date: Tue, 26 Mar 2024 15:44:05 +0100
Subject: [PATCH 5/6] Update Latest-Posts-Hover.php
---
widgets/Latest-Posts-Hover.php | 3336 ++++++++++++++++----------------
1 file changed, 1625 insertions(+), 1711 deletions(-)
diff --git a/widgets/Latest-Posts-Hover.php b/widgets/Latest-Posts-Hover.php
index f8ad88b..470e903 100644
--- a/widgets/Latest-Posts-Hover.php
+++ b/widgets/Latest-Posts-Hover.php
@@ -1,1796 +1,1710 @@
-<<<<<<< HEAD
-
-=======
-
->>>>>>> fb75035c574edd38fcbb371b94878f49a8b99ba1
-start_controls_section(
- 'section_general',
- [
- 'label' => esc_html__('General', 'Latest-Posts-Hover'),
- ]
- );
- $this->add_control(
- 'all_post',
- [
- 'label' => esc_html__('All post', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'all',
- 'default' => 'normal',
- ]
- );
- $this->add_control(
- 'posts_per_page',
- [
- 'label' => esc_html__('Number of Posts', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::NUMBER,
- 'default' => 4,
- 'min' => 1,
- ]
- );
- $this->add_control(
- 'default_image',
- [
- 'label' => esc_html__('Default Image', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::MEDIA,
- 'default' => [
- 'url' => \Elementor\Utils::get_placeholder_image_src(),
- ],
- ]
- );
- $this->add_control(
- 'card_color',
- [
- 'label' => esc_html__('Background color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => '#f8f8f8',
- ]
- );
- $this->add_control(
- 'card_opacity',
- [
- 'label' => esc_html__('Card opacity', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::NUMBER,
- 'default' => 0.8,
- 'min' => 0,
- 'max' => 1,
- 'step' => 0.1,
- 'selectors' => [
- '{{WRAPPER}} .title' => 'filter:{{VALUE}}!important;',
- ],
- ]
- );
+ public function get_categories()
+ {
+ return ['OpenWidget'];
+ }
- $this->add_control(
- 'selected_page',
- [
- 'label' => esc_html__(' Select Page if you have a page with all post, made with this widget for the links', 'OpenWidget'),
- 'type' => \Elementor\Controls_Manager::SELECT,
- 'options' => $this->get_pages(),
- 'default' => 0,
- ]
- );
- $this->add_control(
- 'filter_alignment',
- [
- 'label' => esc_html__('Filter Alignment', 'OpenWidget'),
- 'type' => \Elementor\Controls_Manager::CHOOSE,
- 'options' => [
- 'left' => [
- 'title' => esc_html__('Left', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignleft',
- ],
- 'center' => [
- 'title' => esc_html__('Center', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-aligncenter',
- ],
- 'right' => [
- 'title' => esc_html__('Right', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignright',
- ],
- ],
- 'default' => 'left',
- 'toggle' => true,
- 'selectors' => [
- '{{WRAPPER}} .category-filter' => 'justify-content: {{VALUE}};',
- ],
- 'icon_colors' => [
- 'left' => 'white',
- 'center' => 'white',
- 'right' => 'white',
- ],
- ]
- );
- $this->end_controls_section();
+ protected function _register_controls()
+ {
+ $this->start_controls_section(
+ 'section_general',
+ [
+ 'label' => esc_html__('General', 'Latest-Posts-Hover'),
+ ]
+ );
+ $this->add_control(
+ 'all_post',
+ [
+ 'label' => esc_html__('All post', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'all',
+ 'default' => 'normal',
+ ]
+ );
+ $this->add_control(
+ 'posts_per_page',
+ [
+ 'label' => esc_html__('Number of Posts', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::NUMBER,
+ 'default' => 4,
+ 'min' => 1,
+ ]
+ );
+ $this->add_control(
+ 'default_image',
+ [
+ 'label' => esc_html__('Default Image', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::MEDIA,
+ 'default' => [
+ 'url' => \Elementor\Utils::get_placeholder_image_src(),
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .info' => 'background-color:{{VALUE}}!important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'card_color',
+ [
+ 'label' => esc_html__('Background color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => '#f8f8f8',
+ 'selectors' => [
+ '{{WRAPPER}} .info' => 'background-color:{{VALUE}}!important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'card_opacity',
+ [
+ 'label' => esc_html__('Card opacity', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::NUMBER,
+ 'min' => 0,
+ 'max' => 1,
+ 'step' => 0.1,
+ 'selectors' => [
+ '{{WRAPPER}} .info' => 'filter:opacity({{VALUE}})!important;',
+ ],
+ ]
+ );
- $this->start_controls_section(
- 'section_title',
- [
- 'label' => esc_html__('Title', 'Latest-Posts-Hover'),
- ]
- );
- $this->add_control(
- 'Title_color',
- [
- 'label' => esc_html__('Color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'black',
- 'selectors' => [
- '{{WRAPPER}} .title' => 'color: {{VALUE}}!important;',
- ],
- ]
- );
- $this->add_control(
- 'title_font_size',
- [
- 'label' => esc_html__('Font Size', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SLIDER,
- 'default' => [
- 'size' => 30,
- 'unit' => 'px',
- ],
- 'range' => [
- 'px' => [
- 'min' => 1,
- 'max' => 120,
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} .title' => 'font-size: {{SIZE}}{{UNIT}};',
- ],
- ]
- );
- $this->add_control(
- 'title_font',
- [
- 'label' => esc_html__('Font Family', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::FONT,
- 'default' => "Work Sans",
- 'selectors' => [
- '{{WRAPPER}} .title' => 'font-family: {{VALUE}}',
- ],
- ]
- );
- $this->add_control(
- 'title_bold',
- [
- 'label' => esc_html__('Title Bold', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'bold',
- 'default' => 'normal',
- 'selectors' => [
- '{{WRAPPER}} .title' => 'font-weight: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'title_alignment',
- [
- 'label' => esc_html__('Title Alignment', 'OpenWidget'),
- 'type' => \Elementor\Controls_Manager::CHOOSE,
- 'options' => [
- 'left' => [
- 'title' => esc_html__('Left', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignleft',
- ],
- 'center' => [
- 'title' => esc_html__('Center', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-aligncenter',
- ],
- 'right' => [
- 'title' => esc_html__('Right', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignright',
- ],
- ],
- 'default' => 'left',
- 'toggle' => true,
- 'selectors' => [
- '{{WRAPPER}} .title' => 'text-align: {{VALUE}};',
- ],
- 'icon_colors' => [
- 'left' => 'white',
- 'center' => 'white',
- 'right' => 'white',
- ],
- ]
- );
- $this->end_controls_section();
- $this->start_controls_section(
- 'section_date',
- [
- 'label' => esc_html__('Date', 'Latest-Posts-Hover'),
- ]
- );
- $this->add_control(
- 'date_active',
- [
- 'label' => esc_html__('Date Active', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'inline-block',
- 'default' => 'none',
- 'selectors' => [
- '{{WRAPPER}} .date' => 'display: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'Date_color',
- [
- 'label' => esc_html__('Color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'black',
- 'selectors' => [
- '{{WRAPPER}} .date' => 'color: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'date_font_size',
- [
- 'label' => esc_html__('Font Size', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SLIDER,
- 'default' => [
- 'size' => 18,
- 'unit' => 'px',
- ],
- 'range' => [
- 'px' => [
- 'min' => 1,
- 'max' => 120,
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} .date' => 'font-size: {{SIZE}}{{UNIT}};',
- ],
- ]
- );
- $this->add_control(
- 'date_font',
- [
- 'label' => esc_html__('Font Date', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::FONT,
- 'default' => "Work Sans",
- 'selectors' => [
- '{{WRAPPER}} .date' => 'font-family: {{VALUE}}',
- ],
- ]
- );
- $this->add_control(
- 'date_bold',
- [
- 'label' => esc_html__('Date Bold', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'bold',
- 'default' => 'normal',
- 'selectors' => [
- '{{WRAPPER}} .date' => 'font-weight: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'date_alignment',
- [
- 'label' => esc_html__('Date Alignment', 'OpenWidget'),
- 'type' => \Elementor\Controls_Manager::CHOOSE,
- 'options' => [
- 'left' => [
- 'title' => esc_html__('Left', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignleft',
- ],
- 'center' => [
- 'title' => esc_html__('Center', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-aligncenter',
- ],
- 'right' => [
- 'title' => esc_html__('Right', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignright',
- ],
- ],
- 'default' => 'left',
- 'toggle' => true,
- 'selectors' => [
- '{{WRAPPER}} .date-card2' => 'justify-content: {{VALUE}};',
- ],
- 'icon_colors' => [
- 'left' => 'white',
- 'center' => 'white',
- 'right' => 'white',
- ],
- ]
- );
- $this->end_controls_section();
- $this->start_controls_section(
- 'section_tag',
- [
- 'label' => esc_html__('Tag', 'Latest-Posts-Hover'),
- ]
- );
- $this->add_control(
- 'tag_active',
- [
- 'label' => esc_html__('Tag Active', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'inline-block',
- 'default' => 'none',
- 'selectors' => [
- '{{WRAPPER}} .tag' => 'display: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'Tag_color',
- [
- 'label' => esc_html__('Color Tag', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'black',
- 'selectors' => [
- '{{WRAPPER}} .tag' => 'color: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'tag_font_size',
- [
- 'label' => esc_html__('Size Tag', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SLIDER,
- 'default' => [
- 'size' => 18,
- 'unit' => 'px',
- ],
- 'range' => [
- 'px' => [
- 'min' => 1,
- 'max' => 120,
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} .tag' => 'font-size: {{SIZE}}{{UNIT}};',
- ],
- ]
- );
- $this->add_control(
- 'tag_font',
- [
- 'label' => esc_html__('Font tag', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::FONT,
- 'default' => "Work Sans",
- 'selectors' => [
- '{{WRAPPER}} .tag' => 'font-family: {{VALUE}}',
- ],
- ]
- );
- $this->add_control(
- 'tag_bold',
- [
- 'label' => esc_html__('Tag Bold', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'bold',
- 'default' => 'normal',
- 'selectors' => [
- '{{WRAPPER}} .tag' => 'font-weight: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'tag_alignment',
- [
- 'label' => esc_html__('Tag Alignment', 'OpenWidget'),
- 'type' => \Elementor\Controls_Manager::CHOOSE,
- 'options' => [
- 'left' => [
- 'title' => esc_html__('Left', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignleft',
- ],
- 'center' => [
- 'title' => esc_html__('Center', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-aligncenter',
- ],
- 'right' => [
- 'title' => esc_html__('Right', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignright',
- ],
- ],
- 'default' => 'left',
- 'toggle' => true,
- 'selectors' => [
- '{{WRAPPER}} .tag-card2' => 'justify-content: {{VALUE}};',
- ],
- 'icon_colors' => [
- 'left' => 'white',
- 'center' => 'white',
- 'right' => 'white',
- ],
- ]
- );
- $this->end_controls_section();
- $this->start_controls_section(
- 'section_category',
- [
- 'label' => esc_html__('Category', 'Latest-Posts-Hover'),
- ]
- );
- $this->add_control(
- 'category_active',
- [
- 'label' => esc_html__('Category Active', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'inline-block',
- 'default' => 'none',
- 'selectors' => [
- '{{WRAPPER}} .category' => 'display: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'category_color',
- [
- 'label' => esc_html__('Color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'black',
- 'selectors' => [
- '{{WRAPPER}} .category' => 'color: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'category_font_size',
- [
- 'label' => esc_html__('Font Size', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SLIDER,
- 'default' => [
- 'size' => 18,
- 'unit' => 'px',
- ],
- 'range' => [
- 'px' => [
- 'min' => 1,
- 'max' => 120,
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} .category' => 'font-size: {{SIZE}}{{UNIT}};',
- ],
- ]
- );
- $this->add_control(
- 'category_font',
- [
- 'label' => esc_html__('Font Family', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::FONT,
- 'default' => "Work Sans",
- 'selectors' => [
- '{{WRAPPER}} .category' => 'font-family: {{VALUE}}',
- ],
- ]
- );
- $this->add_control(
- 'category_bold',
- [
- 'label' => esc_html__('category Bold', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'bold',
- 'default' => 'normal',
- 'selectors' => [
- '{{WRAPPER}} .category' => 'font-weight: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'category_alignment',
- [
- 'label' => esc_html__('Category Alignment', 'OpenWidget'),
- 'type' => \Elementor\Controls_Manager::CHOOSE,
- 'options' => [
- 'left' => [
- 'title' => esc_html__('Left', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignleft',
- ],
- 'center' => [
- 'title' => esc_html__('Center', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-aligncenter',
- ],
- 'right' => [
- 'title' => esc_html__('Right', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignright',
- ],
- ],
- 'default' => 'left',
- 'toggle' => true,
- 'selectors' => [
-<<<<<<< HEAD
- '{{WRAPPER}} .category-card2' => 'justify-content: {{VALUE}};',
-=======
- '{{WRAPPER}} .category' => 'text-align: {{VALUE}};',
->>>>>>> fb75035c574edd38fcbb371b94878f49a8b99ba1
+ $this->add_control(
+ 'selected_page',
+ [
+ 'label' => esc_html__(' Select Page if you have a page with all post, made with this widget for the links', 'OpenWidget'),
+ 'type' => \Elementor\Controls_Manager::SELECT,
+ 'options' => $this->get_pages(),
+ 'default' => 0,
+ ]
+ );
+ $this->add_control(
+ 'filter_alignment',
+ [
+ 'label' => esc_html__('Filter Alignment', 'OpenWidget'),
+ 'type' => \Elementor\Controls_Manager::CHOOSE,
+ 'options' => [
+ 'left' => [
+ 'title' => esc_html__('Left', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignleft',
+ ],
+ 'center' => [
+ 'title' => esc_html__('Center', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-aligncenter',
+ ],
+ 'right' => [
+ 'title' => esc_html__('Right', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignright',
+ ],
+ ],
+ 'default' => 'left',
+ 'toggle' => true,
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter' => 'justify-content: {{VALUE}};',
+ ],
+ 'icon_colors' => [
+ 'left' => 'white',
+ 'center' => 'white',
+ 'right' => 'white',
+ ],
+ ]
+ );
+ $this->end_controls_section();
+ $this->start_controls_section(
+ 'section_error',
+ [
+ 'label' => esc_html__('No post error', 'Latest-Posts-Hover'),
+ ]
+ );
+ $this->add_control(
+ 'Error_color',
+ [
+ 'label' => esc_html__('Text color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'black',
+ 'selectors' => [
+ '{{WRAPPER}} .error-message' => 'color: {{VALUE}}!important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'Error_font_size',
+ [
+ 'label' => esc_html__('Font Size', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SLIDER,
+ 'default' => [
+ 'size' => 30,
+ 'unit' => 'px',
+ ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 120,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .error-message' => 'font-size: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'error_font',
+ [
+ 'label' => esc_html__('Font Family', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::FONT,
+ 'default' => "Work Sans",
+ 'selectors' => [
+ '{{WRAPPER}} .error-message' => 'font-family: {{VALUE}}',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'error_bold',
+ [
+ 'label' => esc_html__('Error Bold', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'bold',
+ 'default' => 'normal',
+ 'selectors' => [
+ '{{WRAPPER}} .error-message' => 'font-weight: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'error_alignment',
+ [
+ 'label' => esc_html__('Error Alignment', 'OpenWidget'),
+ 'type' => \Elementor\Controls_Manager::CHOOSE,
+ 'options' => [
+ 'left' => [
+ 'title' => esc_html__('Left', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignleft',
+ ],
+ 'center' => [
+ 'title' => esc_html__('Center', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-aligncenter',
+ ],
+ 'right' => [
+ 'title' => esc_html__('Right', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignright',
+ ],
+ ],
+ 'default' => 'left',
+ 'toggle' => true,
+ 'selectors' => [
+ '{{WRAPPER}} .error-message' => 'text-align: {{VALUE}};',
+ ],
+ 'icon_colors' => [
+ 'left' => 'white',
+ 'center' => 'white',
+ 'right' => 'white',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'error_message',
+ [
+ 'type' => \Elementor\Controls_Manager::TEXT,
+ 'label' => esc_html__('Error message', 'textdomain'),
+ 'placeholder' => esc_html__('Error message', 'textdomain'),
+ 'default' => 'No post found',
+ ]
+ );
+ $this->end_controls_section();
+ $this->start_controls_section(
+ 'section_title',
+ [
+ 'label' => esc_html__('Title', 'Latest-Posts-Hover'),
+ ]
+ );
+ $this->add_control(
+ 'Title_color',
+ [
+ 'label' => esc_html__('Color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'black',
+ 'selectors' => [
+ '{{WRAPPER}} .title' => 'color: {{VALUE}}!important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'title_font_size',
+ [
+ 'label' => esc_html__('Font Size', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SLIDER,
+ 'default' => [
+ 'size' => 30,
+ 'unit' => 'px',
+ ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 120,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .title' => 'font-size: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'title_font',
+ [
+ 'label' => esc_html__('Font Family', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::FONT,
+ 'default' => "Work Sans",
+ 'selectors' => [
+ '{{WRAPPER}} .title' => 'font-family: {{VALUE}}',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'title_bold',
+ [
+ 'label' => esc_html__('Title Bold', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'bold',
+ 'default' => 'normal',
+ 'selectors' => [
+ '{{WRAPPER}} .title' => 'font-weight: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'title_alignment',
+ [
+ 'label' => esc_html__('Title Alignment', 'OpenWidget'),
+ 'type' => \Elementor\Controls_Manager::CHOOSE,
+ 'options' => [
+ 'left' => [
+ 'title' => esc_html__('Left', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignleft',
+ ],
+ 'center' => [
+ 'title' => esc_html__('Center', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-aligncenter',
+ ],
+ 'right' => [
+ 'title' => esc_html__('Right', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignright',
+ ],
+ ],
+ 'default' => 'left',
+ 'toggle' => true,
+ 'selectors' => [
+ '{{WRAPPER}} .title' => 'text-align: {{VALUE}};',
+ ],
+ 'icon_colors' => [
+ 'left' => 'white',
+ 'center' => 'white',
+ 'right' => 'white',
+ ],
+ ]
+ );
+ $this->end_controls_section();
+ $this->start_controls_section(
+ 'section_date',
+ [
+ 'label' => esc_html__('Date', 'Latest-Posts-Hover'),
+ ]
+ );
+ $this->add_control(
+ 'date_active',
+ [
+ 'label' => esc_html__('Date Active', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'inline-block',
+ 'default' => 'none',
+ 'selectors' => [
+ '{{WRAPPER}} .date' => 'display: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'Date_color',
+ [
+ 'label' => esc_html__('Color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'black',
+ 'selectors' => [
+ '{{WRAPPER}} .date' => 'color: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'date_font_size',
+ [
+ 'label' => esc_html__('Font Size', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SLIDER,
+ 'default' => [
+ 'size' => 18,
+ 'unit' => 'px',
+ ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 120,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .date' => 'font-size: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'date_font',
+ [
+ 'label' => esc_html__('Font Date', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::FONT,
+ 'default' => "Work Sans",
+ 'selectors' => [
+ '{{WRAPPER}} .date' => 'font-family: {{VALUE}}',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'date_bold',
+ [
+ 'label' => esc_html__('Date Bold', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'bold',
+ 'default' => 'normal',
+ 'selectors' => [
+ '{{WRAPPER}} .date' => 'font-weight: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'date_alignment',
+ [
+ 'label' => esc_html__('Date Alignment', 'OpenWidget'),
+ 'type' => \Elementor\Controls_Manager::CHOOSE,
+ 'options' => [
+ 'left' => [
+ 'title' => esc_html__('Left', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignleft',
+ ],
+ 'center' => [
+ 'title' => esc_html__('Center', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-aligncenter',
+ ],
+ 'right' => [
+ 'title' => esc_html__('Right', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignright',
+ ],
+ ],
+ 'default' => 'left',
+ 'toggle' => true,
+ 'selectors' => [
+ '{{WRAPPER}} .date-card2' => 'justify-content: {{VALUE}};',
+ ],
+ 'icon_colors' => [
+ 'left' => 'white',
+ 'center' => 'white',
+ 'right' => 'white',
+ ],
+ ]
+ );
+ $this->end_controls_section();
+ $this->start_controls_section(
+ 'section_tag',
+ [
+ 'label' => esc_html__('Tag', 'Latest-Posts-Hover'),
+ ]
+ );
+ $this->add_control(
+ 'tag_active',
+ [
+ 'label' => esc_html__('Tag Active', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'inline-block',
+ 'default' => 'none',
+ 'selectors' => [
+ '{{WRAPPER}} .tag' => 'display: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'Tag_color',
+ [
+ 'label' => esc_html__('Color Tag', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'black',
+ 'selectors' => [
+ '{{WRAPPER}} .tag' => 'color: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'tag_font_size',
+ [
+ 'label' => esc_html__('Size Tag', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SLIDER,
+ 'default' => [
+ 'size' => 18,
+ 'unit' => 'px',
+ ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 120,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .tag' => 'font-size: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'tag_font',
+ [
+ 'label' => esc_html__('Font tag', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::FONT,
+ 'default' => "Work Sans",
+ 'selectors' => [
+ '{{WRAPPER}} .tag' => 'font-family: {{VALUE}}',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'tag_bold',
+ [
+ 'label' => esc_html__('Tag Bold', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'bold',
+ 'default' => 'normal',
+ 'selectors' => [
+ '{{WRAPPER}} .tag' => 'font-weight: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'tag_alignment',
+ [
+ 'label' => esc_html__('Tag Alignment', 'OpenWidget'),
+ 'type' => \Elementor\Controls_Manager::CHOOSE,
+ 'options' => [
+ 'left' => [
+ 'title' => esc_html__('Left', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignleft',
+ ],
+ 'center' => [
+ 'title' => esc_html__('Center', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-aligncenter',
+ ],
+ 'right' => [
+ 'title' => esc_html__('Right', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignright',
+ ],
+ ],
+ 'default' => 'left',
+ 'toggle' => true,
+ 'selectors' => [
+ '{{WRAPPER}} .tag-card2' => 'justify-content: {{VALUE}};',
+ ],
+ 'icon_colors' => [
+ 'left' => 'white',
+ 'center' => 'white',
+ 'right' => 'white',
+ ],
+ ]
+ );
+ $this->end_controls_section();
+ $this->start_controls_section(
+ 'section_category',
+ [
+ 'label' => esc_html__('Category', 'Latest-Posts-Hover'),
+ ]
+ );
+ $this->add_control(
+ 'category_active',
+ [
+ 'label' => esc_html__('Category Active', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'flex',
+ 'default' => 'none',
+ 'selectors' => [
+ '{{WRAPPER}} .category' => 'display: {{VALUE}};',
+ '{{WRAPPER}} .category-card2' => 'display: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'category_color',
+ [
+ 'label' => esc_html__('Color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'black',
+ 'selectors' => [
+ '{{WRAPPER}} .category' => 'color: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'category_font_size',
+ [
+ 'label' => esc_html__('Font Size', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SLIDER,
+ 'default' => [
+ 'size' => 18,
+ 'unit' => 'px',
+ ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 120,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .category' => 'font-size: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'category_font',
+ [
+ 'label' => esc_html__('Font Family', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::FONT,
+ 'default' => "Work Sans",
+ 'selectors' => [
+ '{{WRAPPER}} .category' => 'font-family: {{VALUE}}',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'category_bold',
+ [
+ 'label' => esc_html__('category Bold', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'bold',
+ 'default' => 'normal',
+ 'selectors' => [
+ '{{WRAPPER}} .category' => 'font-weight: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'category_alignment',
+ [
+ 'label' => esc_html__('Category Alignment', 'OpenWidget'),
+ 'type' => \Elementor\Controls_Manager::CHOOSE,
+ 'options' => [
+ 'left' => [
+ 'title' => esc_html__('Left', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignleft',
+ ],
+ 'center' => [
+ 'title' => esc_html__('Center', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-aligncenter',
+ ],
+ 'right' => [
+ 'title' => esc_html__('Right', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignright',
+ ],
+ ],
+ 'default' => 'left',
+ 'toggle' => true,
+ 'selectors' => [
+ '{{WRAPPER}} .category-card2' => 'justify-content: {{VALUE}};',
- ],
- 'icon_colors' => [
- 'left' => 'white',
- 'center' => 'white',
- 'right' => 'white',
- ],
- ]
- );
- $this->add_control(
- 'categories_in',
- [
- 'label' => esc_html__('Select Categories to include', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SELECT2,
- 'multiple' => true,
- 'options' => $this->get_category(),
- ]
- );
- $this->add_control(
- 'exclude_categories',
- [
- 'label' => esc_html__('Select Categories to exclude', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SELECT2,
- 'multiple' => true,
- 'options' => $this->get_category(),
- ]
- );
- $this->end_controls_section();
- $this->start_controls_section(
- 'section_content',
- [
- 'label' => esc_html__('Content', 'Latest-Posts-Hover'),
- ]
- );
- $this->add_control(
- 'content_word_pc',
- [
- 'label' => esc_html__('Number of Word on pc', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::NUMBER,
- 'default' => 15,
- 'min' => 1,
- ]
- );
- $this->add_control(
- 'content_word_mobile',
- [
- 'label' => esc_html__('Number of Word on mobile', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::NUMBER,
- 'default' => 15,
- 'min' => 1,
- ]
- );
- $this->add_control(
- 'text_color',
- [
- 'label' => esc_html__('Color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'black',
- 'selectors' => [
- '{{WRAPPER}} .description' => 'color: {{VALUE}} !important;',
- ],
- ]
- );
- $this->add_control(
- 'content_font_size',
- [
- 'label' => esc_html__('Content Font Size', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SLIDER,
- 'default' => [
- 'size' => 18,
- 'unit' => 'px',
- ],
- 'range' => [
- 'px' => [
- 'min' => 1,
- 'max' => 120,
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} .description' => 'font-size: {{SIZE}}{{UNIT}};',
- ],
- ]
- );
- $this->add_control(
- 'content_font',
- [
- 'label' => esc_html__('Content Font Family', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::FONT,
- 'default' => "Work Sans",
- 'selectors' => [
- '{{WRAPPER}} .description' => 'font-family: {{VALUE}}',
- ],
- ]
- );
- $this->add_control(
- 'content_bold',
- [
- 'label' => esc_html__('category Bold', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'bold',
- 'default' => 'normal',
- 'selectors' => [
- '{{WRAPPER}} .description' => 'font-weight: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'content_alignment',
- [
- 'label' => esc_html__('Content Alignment', 'OpenWidget'),
- 'type' => \Elementor\Controls_Manager::CHOOSE,
- 'options' => [
- 'left' => [
- 'title' => esc_html__('Left', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignleft',
- ],
- 'center' => [
- 'title' => esc_html__('Center', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-aligncenter',
- ],
- 'right' => [
- 'title' => esc_html__('Right', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignright',
- ],
- ],
- 'default' => 'left',
- 'toggle' => true,
- 'selectors' => [
- '{{WRAPPER}} .description' => 'text-align: {{VALUE}};',
- ],
- 'icon_colors' => [
- 'left' => 'white',
- 'center' => 'white',
- 'right' => 'white',
- ],
- ]
- );
- $this->end_controls_section();
- $this->start_controls_section(
- 'section_Button_filter',
- [
- 'label' => esc_html__('Button Filter', 'Latest-Posts-Hover'),
- ]
- );
- $this->add_control(
- 'filter_active',
- [
- 'label' => esc_html__('Button Filter Active', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'inline-block',
- 'default' => 'none',
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button' => 'display: {{VALUE}};',
-<<<<<<< HEAD
-=======
- ],
- ]
- );
- $this->add_control(
- 'filter_alignment',
- [
- 'label' => esc_html__('Filter Alignment', 'OpenWidget'),
- 'type' => \Elementor\Controls_Manager::CHOOSE,
- 'options' => [
- 'left' => [
- 'title' => esc_html__('Left', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignleft',
- ],
- 'center' => [
- 'title' => esc_html__('Center', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-aligncenter',
- ],
- 'right' => [
- 'title' => esc_html__('Right', 'OpenWidget'),
- 'icon' => 'mce-ico mce-i-alignright',
- ],
- ],
- 'default' => 'left',
- 'toggle' => true,
- 'selectors' => [
- '{{WRAPPER}} .category-filter' => 'justify-content: {{VALUE}};',
- ],
- 'icon_colors' => [
- 'left' => 'white',
- 'center' => 'white',
- 'right' => 'white',
->>>>>>> fb75035c574edd38fcbb371b94878f49a8b99ba1
- ],
- ]
- );
+ ],
+ 'icon_colors' => [
+ 'left' => 'white',
+ 'center' => 'white',
+ 'right' => 'white',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'categories_in',
+ [
+ 'label' => esc_html__('Select Categories to include', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SELECT2,
+ 'multiple' => true,
+ 'options' => $this->get_category(),
+ ]
+ );
+ $this->add_control(
+ 'exclude_categories',
+ [
+ 'label' => esc_html__('Select Categories to exclude', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SELECT2,
+ 'multiple' => true,
+ 'options' => $this->get_category(),
+ ]
+ );
+ $this->end_controls_section();
+ $this->start_controls_section(
+ 'section_content',
+ [
+ 'label' => esc_html__('Content', 'Latest-Posts-Hover'),
+ ]
+ );
+ $this->add_control(
+ 'content_word_pc',
+ [
+ 'label' => esc_html__('Number of Word on pc', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::NUMBER,
+ 'default' => 15,
+ 'min' => 1,
+ ]
+ );
+ $this->add_control(
+ 'content_word_mobile',
+ [
+ 'label' => esc_html__('Number of Word on mobile', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::NUMBER,
+ 'default' => 15,
+ 'min' => 1,
+ ]
+ );
+ $this->add_control(
+ 'text_color',
+ [
+ 'label' => esc_html__('Color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'black',
+ 'selectors' => [
+ '{{WRAPPER}} .description' => 'color: {{VALUE}} !important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'content_font_size',
+ [
+ 'label' => esc_html__('Content Font Size', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SLIDER,
+ 'default' => [
+ 'size' => 18,
+ 'unit' => 'px',
+ ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 120,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .description' => 'font-size: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'content_font',
+ [
+ 'label' => esc_html__('Content Font Family', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::FONT,
+ 'default' => "Work Sans",
+ 'selectors' => [
+ '{{WRAPPER}} .description' => 'font-family: {{VALUE}}',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'content_bold',
+ [
+ 'label' => esc_html__('category Bold', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'bold',
+ 'default' => 'normal',
+ 'selectors' => [
+ '{{WRAPPER}} .description' => 'font-weight: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'content_alignment',
+ [
+ 'label' => esc_html__('Content Alignment', 'OpenWidget'),
+ 'type' => \Elementor\Controls_Manager::CHOOSE,
+ 'options' => [
+ 'left' => [
+ 'title' => esc_html__('Left', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignleft',
+ ],
+ 'center' => [
+ 'title' => esc_html__('Center', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-aligncenter',
+ ],
+ 'right' => [
+ 'title' => esc_html__('Right', 'OpenWidget'),
+ 'icon' => 'mce-ico mce-i-alignright',
+ ],
+ ],
+ 'default' => 'left',
+ 'toggle' => true,
+ 'selectors' => [
+ '{{WRAPPER}} .description' => 'text-align: {{VALUE}};',
+ ],
+ 'icon_colors' => [
+ 'left' => 'white',
+ 'center' => 'white',
+ 'right' => 'white',
+ ],
+ ]
+ );
- $this->add_control(
- 'text_color_inactive',
- [
- 'label' => esc_html__('Button filter Inactive text color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'white',
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button' => ' color: {{VALUE}} !important;',
- ],
- ]
- );
- $this->add_control(
- 'text_font_inactive',
- [
- 'label' => esc_html__('Button filter Inactive text Font Family', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::FONT,
- 'default' => "Work Sans",
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button' => 'font-family: {{VALUE}}',
- ],
- ]
- );
- $this->add_control(
- 'background_color_inactive',
- [
- 'label' => esc_html__('Button filter Inactive background color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'black',
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button' => ' background-color: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'inactive_font_size',
- [
- 'label' => esc_html__('Button filter Inactive text Font Size', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SLIDER,
- 'default' => [
- 'size' => 18,
- 'unit' => 'px',
- ],
- 'range' => [
- 'px' => [
- 'min' => 1,
- 'max' => 120,
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button' => 'font-size: {{SIZE}}{{UNIT}};',
- ],
- ]
- );
- $this->add_control(
- 'Text_inactive_bold',
- [
- 'label' => esc_html__('Button filter Inactive text bold', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'bold',
- 'default' => 'normal',
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button' => 'font-weight: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'text_color_active',
- [
- 'label' => esc_html__('Button filter Active text clor', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'white',
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button.active' => ' color: {{VALUE}} !important;',
- ],
- ]
- );
- $this->add_control(
- 'text_font_active',
- [
- 'label' => esc_html__('Button filter Active text Font Family', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::FONT,
- 'default' => "Work Sans",
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button.active' => 'font-family: {{VALUE}}',
- ],
- ]
- );
- $this->add_control(
- 'background_color_active',
- [
- 'label' => esc_html__('Button filter Active background color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'red',
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button.active' => ' background-color: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'active_font_size',
- [
- 'label' => esc_html__('Button filter Active text Font Size', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SLIDER,
- 'default' => [
- 'size' => 18,
- 'unit' => 'px',
- ],
- 'range' => [
- 'px' => [
- 'min' => 1,
- 'max' => 120,
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button.active' => 'font-size: {{SIZE}}{{UNIT}};',
- ],
- ]
- );
- $this->add_control(
- 'Text_active_bold',
- [
- 'label' => esc_html__('Button filter Active text bold ', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'bold',
- 'default' => 'normal',
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button.active' => 'font-weight: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'text_color_hover',
- [
- 'label' => esc_html__('Button filter Hover text color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'white',
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button:hover' => ' color: {{VALUE}} !important;',
- ],
- ]
- );
- $this->add_control(
- 'text_font_hover',
- [
- 'label' => esc_html__('Button filter hover text Font Family', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::FONT,
- 'default' => "Work Sans",
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button:hover' => 'font-family: {{VALUE}}',
- ],
- ]
- );
- $this->add_control(
- 'background_color_hover',
- [
- 'label' => esc_html__('Button filter Hover background color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'orange',
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button:hover' => ' background-color: {{VALUE}};',
- ],
- ]
- );
+ $this->end_controls_section();
+ $this->start_controls_section(
+ 'section_Button_filter',
+ [
+ 'label' => esc_html__('Button Filter', 'Latest-Posts-Hover'),
+ ]
+ );
+ $this->add_control(
+ 'filter_active',
+ [
+ 'label' => esc_html__('Button Filter Active', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'inline-block',
+ 'default' => 'none',
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button' => 'display: {{VALUE}};',
+ ],
+ ]
+ );
- $this->add_control(
- 'hover_font_size',
- [
- 'label' => esc_html__('Button filter Hover text Font Size', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SLIDER,
- 'default' => [
- 'size' => 18,
- 'unit' => 'px',
- ],
- 'range' => [
- 'px' => [
- 'min' => 1,
- 'max' => 120,
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button:hover' => 'font-size: {{SIZE}}{{UNIT}};',
- ],
- ]
- );
- $this->add_control(
- 'Text_hover_bold',
- [
- 'label' => esc_html__(' Button filter Hover text Bold', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'bold',
- 'default' => 'normal',
- 'selectors' => [
- '{{WRAPPER}} .category-filter-button:hover' => 'font-weight: {{VALUE}};',
- ],
- ]
- );
-<<<<<<< HEAD
+ $this->add_control(
+ 'text_color_inactive',
+ [
+ 'label' => esc_html__('Button filter Inactive text color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'white',
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button' => ' color: {{VALUE}} !important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'text_font_inactive',
+ [
+ 'label' => esc_html__('Button filter Inactive text Font Family', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::FONT,
+ 'default' => "Work Sans",
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button' => 'font-family: {{VALUE}}',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'background_color_inactive',
+ [
+ 'label' => esc_html__('Button filter Inactive background color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'black',
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button' => ' background-color: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'inactive_font_size',
+ [
+ 'label' => esc_html__('Button filter Inactive text Font Size', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SLIDER,
+ 'default' => [
+ 'size' => 18,
+ 'unit' => 'px',
+ ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 120,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button' => 'font-size: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'Text_inactive_bold',
+ [
+ 'label' => esc_html__('Button filter Inactive text bold', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'bold',
+ 'default' => 'normal',
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button' => 'font-weight: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'text_color_active',
+ [
+ 'label' => esc_html__('Button filter Active text clor', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'white',
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button.active' => ' color: {{VALUE}} !important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'text_font_active',
+ [
+ 'label' => esc_html__('Button filter Active text Font Family', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::FONT,
+ 'default' => "Work Sans",
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button.active' => 'font-family: {{VALUE}}',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'background_color_active',
+ [
+ 'label' => esc_html__('Button filter Active background color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'red',
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button.active' => ' background-color: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'active_font_size',
+ [
+ 'label' => esc_html__('Button filter Active text Font Size', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SLIDER,
+ 'default' => [
+ 'size' => 18,
+ 'unit' => 'px',
+ ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 120,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button.active' => 'font-size: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'Text_active_bold',
+ [
+ 'label' => esc_html__('Button filter Active text bold ', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'bold',
+ 'default' => 'normal',
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button.active' => 'font-weight: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'text_color_hover',
+ [
+ 'label' => esc_html__('Button filter Hover text color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'white',
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button:hover' => ' color: {{VALUE}} !important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'text_font_hover',
+ [
+ 'label' => esc_html__('Button filter hover text Font Family', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::FONT,
+ 'default' => "Work Sans",
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button:hover' => 'font-family: {{VALUE}}',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'background_color_hover',
+ [
+ 'label' => esc_html__('Button filter Hover background color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'orange',
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button:hover' => ' background-color: {{VALUE}};',
+ ],
+ ]
+ );
-=======
-
->>>>>>> fb75035c574edd38fcbb371b94878f49a8b99ba1
- $this->add_control(
- 'related_category',
- [
- 'label' => esc_html__('Show categories related to the one one you selected', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'on',
- 'default' => 'off',
- ]
- );
- $this->add_control(
- 'include_all',
- [
- 'label' => esc_html__('Show all even if someone is excluded', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('on', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'on',
- 'default' => 'off',
- ]
- );
- $this->end_controls_section();
- $this->start_controls_section(
- 'section_search',
- [
-<<<<<<< HEAD
- 'label' => esc_html__('Search', 'Latest-Posts-Hover'),
- ]
- );
-=======
- 'label' => esc_html__('search', 'Latest-Posts-Hover'),
- ]
- );
->>>>>>> fb75035c574edd38fcbb371b94878f49a8b99ba1
- $this->add_control(
- 'search_active',
- [
- 'label' => esc_html__('Search Active', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::SWITCHER,
- 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
- 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
- 'return_value' => 'inline-block',
- 'default' => 'none',
- 'selectors' => [
- '{{WRAPPER}} .container2' => 'display: {{VALUE}};',
- ],
- ]
-<<<<<<< HEAD
- );
-=======
- );
->>>>>>> fb75035c574edd38fcbb371b94878f49a8b99ba1
- $this->add_control(
- 'background_color_input',
- [
- 'label' => esc_html__('Input background color', 'Latest-Posts-Hover'),
- 'type' => \Elementor\Controls_Manager::COLOR,
- 'default' => 'red',
- 'selectors' => [
- '{{WRAPPER}}
-<<<<<<< HEAD
- .container2 .search2 input:focus,.container2 .search2 input:active,.container2 .search2:hover input' => ' background-color: {{VALUE}};',
- ],
- ]
- );
+ $this->add_control(
+ 'hover_font_size',
+ [
+ 'label' => esc_html__('Button filter Hover text Font Size', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SLIDER,
+ 'default' => [
+ 'size' => 18,
+ 'unit' => 'px',
+ ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 120,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button:hover' => 'font-size: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'Text_hover_bold',
+ [
+ 'label' => esc_html__(' Button filter Hover text Bold', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'bold',
+ 'default' => 'normal',
+ 'selectors' => [
+ '{{WRAPPER}} .category-filter-button:hover' => 'font-weight: {{VALUE}};',
+ ],
+ ]
+ );
- $this->end_controls_section();
-=======
- .container2 .search input:focus,.container2 .search input:active,.container2 .search:hover input' => ' background-color: {{VALUE}};',
- ],
- ]
- );
-
- $this->end_controls_section();
+ $this->add_control(
+ 'related_category',
+ [
+ 'label' => esc_html__('Show categories related to the one one you selected', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'on',
+ 'default' => 'off',
+ ]
+ );
+ $this->add_control(
+ 'include_all',
+ [
+ 'label' => esc_html__('Show all even if someone is excluded', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('on', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'on',
+ 'default' => 'off',
+ ]
+ );
+ $this->add_control(
+ 'All_place',
+ [
+ 'type' => \Elementor\Controls_Manager::TEXT,
+ 'label' => esc_html__('All button', 'textdomain'),
+ 'placeholder' => esc_html__('All button', 'textdomain'),
+ 'default' => 'All',
+ ]
+ );
+ $this->end_controls_section();
+ $this->start_controls_section(
+ 'section_search',
+ [
+ 'label' => esc_html__('Search', 'Latest-Posts-Hover'),
+ ]
+ );
+ $this->add_control(
+ 'search_active',
+ [
+ 'label' => esc_html__('Search Active', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
+ 'label_on' => esc_html__('On', 'Latest-Posts-Hover'),
+ 'label_off' => esc_html__('Off', 'Latest-Posts-Hover'),
+ 'return_value' => 'inline-block',
+ 'default' => 'none',
+ 'selectors' => [
+ '{{WRAPPER}} .container2' => 'display: {{VALUE}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'background_color_input',
+ [
+ 'label' => esc_html__('Background color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'orange',
+ 'selectors' => [
+ '{{WRAPPER}}
+ .input2' => ' background: {{VALUE}} !important;',
+ '{{WRAPPER}} .input2:focus' => ' background: {{VALUE}}!important;',
+ '{{WRAPPER}} .input2:hover' => ' background: {{VALUE}}!important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'text_color_input',
+ [
+ 'label' => esc_html__('Text color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'black',
+ 'selectors' => [
+ '{{WRAPPER}} .input2' => ' color: {{VALUE}}!important;',
->>>>>>> fb75035c574edd38fcbb371b94878f49a8b99ba1
- }
- private function get_category()
- {
- $categories = get_categories();
- $options = [];
- foreach ($categories as $category) {
- $options[$category->term_id] = $category->name;
+ ],
+ ]
+ );
+ $this->add_control(
+ 'icon_color_',
+ [
+ 'label' => esc_html__('Icon color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'black',
+ 'selectors' => [
+ '{{WRAPPER}} .submit-button' => ' color: {{VALUE}}!important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'cursor_color_',
+ [
+ 'label' => esc_html__('Cursor color', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::COLOR,
+ 'default' => 'black',
+ 'selectors' => [
+ '{{WRAPPER}} .input2' => ' caret-color: {{VALUE}}!important;',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'search_font_size',
+ [
+ 'label' => esc_html__('Search Font Size', 'Latest-Posts-Hover'),
+ 'type' => \Elementor\Controls_Manager::SLIDER,
+ 'default' => [
+ 'size' => 18,
+ 'unit' => 'px',
+ ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 120,
+ ],
+ ],
+ 'selectors' => [
+ '{{WRAPPER}} .input2' => 'font-size: {{SIZE}}{{UNIT}};',
+ ],
+ ]
+ );
+ $this->add_control(
+ 'Search_place',
+ [
+ 'type' => \Elementor\Controls_Manager::TEXT,
+ 'label' => esc_html__('Place', 'textdomain'),
+ 'placeholder' => esc_html__('Placeholder Search', 'textdomain'),
+ 'default' => 'search',
+ ]
+ );
+ $this->end_controls_section();
}
- return $options;
- }
- private function get_pages()
- {
- $pages = get_pages();
- $options = [];
- $options[0] = esc_html__('Default', 'OpenWidget');
- foreach ($pages as $page) {
- $options[$page->ID] = $page->post_title;
+ private function get_category()
+ {
+ $categories = get_categories();
+ $options = [];
+ foreach ($categories as $category) {
+ $options[$category->term_id] = $category->name;
+ }
+ return $options;
+ }
+ private function get_pages()
+ {
+ $pages = get_pages();
+ $options = [];
+ $options[0] = esc_html__('Default', 'OpenWidget');
+ foreach ($pages as $page) {
+ $options[$page->ID] = $page->post_title;
+ }
+ return $options ?: [];
}
- return $options;
- }
- protected function render()
- {
- $settings = $this->get_settings_for_display();
- if ($settings['posts_per_page'] == null) {
- $settings['posts_per_page'] = 4;
- }
- $args = [
- 'posts_per_page' => $settings['posts_per_page'],
- 'category_name' => isset($_GET['category']) ? sanitize_text_field($_GET['category']) : '',
- 'tag' => isset($_GET['tags']) ? sanitize_text_field($_GET['tags']) : '',
- ];
- if (isset($_GET['category']) && ($_GET['category']) == "all") {
- unset($args['category_name']);
- }
- if (isset($_GET['date'])) {
- $date_query = [
- 'after' => $_GET['date'],
- 'inclusive' => true,
+ protected function render()
+
+ {
+ $settings = $this->get_settings_for_display();
+ if ($settings['posts_per_page'] == null) {
+ $settings['posts_per_page'] = 4;
+ }
+ $args = [
+ 'posts_per_page' => $settings['posts_per_page'],
+ 'category_name' => isset($_GET['category']) ? sanitize_text_field($_GET['category']) : '',
+ 'tag' => isset($_GET['tags']) ? sanitize_text_field($_GET['tags']) : '',
];
- $args['date_query'] = $date_query;
- }
- if ($settings['all_post'] == 'all') {
- $args['posts_per_page'] = -1;
- }
-<<<<<<< HEAD
- $selected_page_id = $settings['selected_page'];
-=======
->>>>>>> fb75035c574edd38fcbb371b94878f49a8b99ba1
- $args['category__not_in'] = $settings['exclude_categories'];
- $args['category__in'] = $settings['categories_in'];
- $posts = get_posts($args);
- $cardColor = $settings['card_color'];
- $wordPc = $settings['content_word_pc'];
- $wordMobile = $settings['content_word_mobile'];
- if (count($posts) != 0) {
- $flex = 100 / count($posts);
- }
- if (count($posts) > 4 || count($posts) == 0) {
- $flex = 25;
- }
- $widht = $flex - 1;
- if ($posts) {
-<<<<<<< HEAD
- echo '
';
- if ($selected_page_id != 0) {
- $page_link = get_permalink($selected_page_id);
+ if (isset($_GET['category']) && ($_GET['category']) == "all") {
+ unset($args['category_name']);
+ }
+ if (isset($_GET['date'])) {
+ $date_query = [
+ 'after' => $_GET['date'],
+ 'inclusive' => true,
+ ];
+ $args['date_query'] = $date_query;
+ }
+ if ($settings['all_post'] == 'all') {
+ $args['posts_per_page'] = -1;
+ }
+ $all = $settings['All_place'];
+ $selected_page_id = $settings['selected_page'];
+ $args['category__not_in'] = $settings['exclude_categories'];
+ $args['category__in'] = $settings['categories_in'];
+ if (isset($_GET['input2'])) {
+ $args['s'] = sanitize_text_field($_GET['input2']);
+ }
+ $posts = get_posts($args);
+ $wordPc = $settings['content_word_pc'];
+ $wordMobile = $settings['content_word_mobile'];
+ $place = $settings['Search_place'];
- echo '
';
- echo '
';
- foreach ($posts as $post) {
- $post_title = get_the_title($post->ID);
- if (wp_is_mobile()) {
- $post_content = wp_trim_words($post->post_content, $wordMobile);
- } else {
- $post_content = wp_trim_words($post->post_content, $wordPc);
- }
- $post_date = get_the_date('j F Y', $post->ID);
- $post_link = get_permalink($post->ID);
- $tags = get_the_tags($post->ID);
- $post_numb = get_the_date('Y-m-d', $post->ID);
- $date_array = explode('-', $post_numb);
- // Check if the post has a featured image
- $featured_image = get_the_post_thumbnail_url($post->ID);
- if (!$featured_image) {
- // If not, use the custom default image
- $featured_image = $settings['default_image']['url'];
- }
- if (is_admin()) {
- echo '
';
- } else {
- if (wp_is_mobile()) {
- echo '
';
- } else {
- echo '
';
- }
- }
- echo '
-
-
' . $post_title . ' ';
- if (!empty($tags)) {
+ echo '
+
+
';
if ($selected_page_id != 0) {
- echo '
';
$page_link = get_permalink($selected_page_id);
- foreach ($tags as $tag) {
- $tag_link = add_query_arg('tags', $tag->slug, $page_link);
- echo '
' . $tag->name . ' ';
- }
- echo '
';
- } else {
- echo '
';
+ echo '
';
+ echo '
';
- foreach ($date_parts as $part) {
- if ($i == 1) {
- $date_array[1] = $date_array[1] . '/01';
+ foreach ($posts as $post) {
+ $post_title = get_the_title($post->ID);
+ if (wp_is_mobile()) {
+ $post_content = wp_trim_words($post->post_content, $wordMobile);
+ } else {
+ $post_content = wp_trim_words($post->post_content, $wordPc);
}
- $date_link = add_query_arg('date', $date_array[$i], $page_link);
- echo '
' . ucfirst($part) . '';
- $i -= 1;
- }
- echo '
';
- } else {
- echo '
';
- $i = 2;
- foreach ($date_parts as $part) {
- $date_link = home_url() . '/' . $date_array[$i];
- echo '
' . ucfirst($part) . '';
- $i -= 1;
- }
- echo '
';
- }
-
- if ($selected_page_id != 0) {
- $page_link = get_permalink($selected_page_id);
- $categories = get_the_category($post->ID);
- if (!empty($categories)) {
- echo '
';
- foreach ($categories as $category) {
- $category_link = add_query_arg('category', $category->slug, $page_link);
- echo '
' . $category->name . ' ';
+ $post_date = get_the_date('j F Y', $post->ID);
+ $post_link = get_permalink($post->ID);
+ $tags = get_the_tags($post->ID);
+ $post_numb = get_the_date('Y-m-d', $post->ID);
+ $date_array = explode('-', $post_numb);
+ // Check if the post has a featured image
+ $featured_image = get_the_post_thumbnail_url($post->ID);
+ if (!$featured_image) {
+ // If not, use the custom default image
+ $featured_image = $settings['default_image']['url'];
}
- echo '
';
- }
- } else {
- $categories = get_the_category($post->ID);
- if (!empty($categories)) {
- echo '
';
- foreach ($categories as $category) {
- echo '
' . $category->name . ' ';
+ if (is_admin()) {
+ echo '
';
+ } else {
+ if (wp_is_mobile()) {
+ echo '
';
+ } else {
+ echo '
';
+ }
}
- }
- echo '
';
- }
- echo '
' . $post_content . '
-
-
';
- }
- wp_reset_postdata();
- echo '
';
-=======
- echo '
-