/* 
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 1.0.1
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/*
    Add your custom styles here
*/

function custom_order_by_post_type($query) {
    if (!is_admin() && $query->is_main_query() && (is_archive() || is_search())) {
        $query->set('post_type', array('history', 'citizenship', 'current_affairs', 'items')); // הסדר הרצוי
        $query->set('orderby', 'post_type'); // מיון לפי סוג הפוסט
        $query->set('order', 'ASC'); // סדר עולה
    }
}
add_action('pre_get_posts', 'custom_order_by_post_type');


function custom_tag_cloud_limit($args) {
    $args['number'] = 25;
    $args['orderby'] = 'count';
    $args['order'] = 'DESC';
    return $args;
}
add_filter('widget_tag_cloud_args', 'custom_tag_cloud_limit');