str_replace('|', '%7C','Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i'), 'subset' => 'latin,latin-ext' ); wp_deregister_style('google-fonts'); wp_enqueue_style('google-fonts', add_query_arg ( $googleFontsArgs, "https://fonts.googleapis.com/css" ), array(), '1.0.0' ); } add_action( 'wp_enqueue_scripts', 'attimo_enqueue_scripts', 999); } /*-----------------------------------------------------------------------------------*/ /* Replace hooks */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('attimo_replace_hooks')) { function attimo_replace_hooks() { remove_action('avventura_lite_slick_slider', 'avventura_lite_slick_slider_function'); remove_action('avventura_lite_top_sidebar', 'avventura_lite_top_sidebar_function'); remove_action('avventura_lite_thumbnail', 'avventura_lite_thumbnail_function'); remove_action('avventura_lite_before_content', 'avventura_lite_before_content_function' ); } add_action('init','attimo_replace_hooks'); } /*-----------------------------------------------------------------------------------*/ /* Exclude sticky posts on home */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('attimo_exclude_sticky_posts_on_home')) { function attimo_exclude_sticky_posts_on_home($query) { if ( $query->is_home() && $query->is_main_query() && (!avventura_lite_setting('attimo_sticky_posts') || strstr(avventura_lite_setting('attimo_sticky_posts'), 'layout' ))) { $query->set('post__not_in', get_option( 'sticky_posts' )); } } add_action('pre_get_posts', 'attimo_exclude_sticky_posts_on_home'); } /*-----------------------------------------------------------------------------------*/ /* Sticky post grid */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('attimo_sticky_posts_function')) { function attimo_sticky_posts_function() { $isHome = ( !avventura_lite_setting('attimo_sticky_posts') || strstr(avventura_lite_setting('attimo_sticky_posts'), 'layout' )) ? TRUE : FALSE; $isSlideshow = ( $isHome == TRUE && ( is_home() || is_front_page()) ) ? TRUE : FALSE; $args = array( 'post_type' => 'post', 'posts_per_page' => 4, 'post__in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => 1, 'meta_query' => array( array( 'key' => '_thumbnail_id', 'compare' => 'EXISTS' ) ) ); $query = new WP_Query($args); if ( $isSlideshow && $query->have_posts() ) : ?>
have_posts() ) : $query->the_post(); global $post; $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large'); ?>

'; foreach ( $categories as $category ) { echo ''; } echo '
'; } ?>
remove_control( 'avventura_lite_header_layout'); $wp_customize->remove_section( 'slideshow_section'); $wp_customize->add_setting( 'attimo_sticky_posts', array( 'default' => 'layout-1', 'sanitize_callback' => 'attimo_select_sanitize', )); $wp_customize->add_control( 'attimo_sticky_posts' , array( 'type' => 'select', 'priority' => '09', 'section' => 'settings_section', 'label' => esc_html__('Sticky post grid','attimo'), 'description' => esc_html__('Do you want to enable the sticky post grid on homepage?.','attimo'), 'choices' => array ( 'disable' => esc_html__( 'Disable','attimo'), 'layout-1' => esc_html__( 'Layout 1','attimo'), 'layout-2' => esc_html__( 'Layout 2','attimo'), 'layout-3' => esc_html__( 'Layout 3','attimo'), 'layout-4' => esc_html__( 'Layout 4','attimo'), ), )); function attimo_select_sanitize ($value, $setting) { global $wp_customize; $control = $wp_customize->get_control( $setting->id ); if ( array_key_exists( $value, $control->choices ) ) { return $value; } else { return $setting->default; } } } add_action( 'customize_register', 'attimo_customize_register', 11 ); } /*-----------------------------------------------------------------------------------*/ /* Theme setup */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('attimo_theme_setup')) { function attimo_theme_setup() { load_child_theme_textdomain( 'attimo', get_stylesheet_directory() . '/languages' ); require_once( trailingslashit( get_stylesheet_directory() ) . 'core/functions/function-style.php' ); remove_theme_support( 'custom-logo'); $defaults = array( 'header-text' => array( 'site-title', 'site-description' )); add_theme_support( 'custom-logo', $defaults ); } add_action( 'after_setup_theme', 'attimo_theme_setup', 999); } /*-----------------------------------------------------------------------------------*/ /* Widgets init */ /*-----------------------------------------------------------------------------------*/ if (!function_exists('attimo_widgets_init')) { function attimo_widgets_init() { register_sidebar(array( 'name' => esc_html__('Banner widget area','attimo'), 'id' => 'attimo-banner-widget-area', 'description' => esc_html__('This widget area will be shown near the logo (Recommended for the image widget).', 'attimo'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); } add_action( 'widgets_init', 'attimo_widgets_init' ); } if (!function_exists('attimo_thumbnail_function')) { function attimo_thumbnail_function($id, $icon = 'on') { global $post; $class = ( $icon == "on" ) ? '' : 'no-overlay'; if ( '' != get_the_post_thumbnail() ) { ?>
'; if ( $icon == "on" ): echo avventura_lite_posticon(); endif; foreach ( $categories as $category ) { echo '
' . esc_html($category->name) . '
'; } echo '
'; } ?> ' . get_the_author_posts_link() . ' - ' . esc_html(get_the_date()) . ''; endif; } add_action( 'avventura_lite_before_content', 'attimo_before_content_function' ); } ?>