Your IP : 216.73.216.162


Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/
Upload File :
Current File : /home/x/b/o/xbodynamge/namtation/wp-content/front-page.tar

class-hestia-about-controls.php000066600000010671151136072130012616 0ustar00<?php
/**
 * About controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_About_Controls
 */
class Hestia_About_Controls extends Hestia_Register_Customizer_Controls {
	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->add_about_section();
		$this->add_hiding_control();
		$this->add_content_control();
		$this->add_pagebuilder_button_control();
		$this->add_background_control();
	}

	/**
	 * Add the section.
	 */
	private function add_about_section() {
		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_about',
				array(
					'title'          => esc_html__( 'About', 'hestia' ),
					'panel'          => 'hestia_frontpage_sections',
					'priority'       => apply_filters( 'hestia_section_priority', 15, 'hestia_about' ),
					'hiding_control' => 'hestia_about_hide',
				),
				'Hestia_Hiding_Section'
			)
		);
	}

	/**
	 * Add hiding control.
	 */
	private function add_hiding_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_about_hide',
				array(
					'sanitize_callback' => 'hestia_sanitize_checkbox',
					'default'           => false,
					'transport'         => $this->selective_refresh,
				),
				array(
					'type'     => 'checkbox',
					'label'    => esc_html__( 'Disable section', 'hestia' ),
					'section'  => 'hestia_about',
					'priority' => 1,
				)
			)
		);
	}

	/**
	 * Add about section content editor control.
	 */
	private function add_content_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_page_editor',
				array(
					'default'           => $this->get_about_content_default(),
					'sanitize_callback' => 'wp_kses_post',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'           => esc_html__( 'About Content', 'hestia' ),
					'section'         => 'hestia_about',
					'priority'        => 10,
					'needsync'        => true,
					'active_callback' => array( $this, 'should_display_content_editor' ),
				),
				'Hestia_Page_Editor',
				array(
					'selector'        => '.hestia-about-content',
					'settings'        => 'hestia_page_editor',
					'render_callback' => array( $this, 'about_content_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add the page builder button control.
	 */
	private function add_pagebuilder_button_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_elementor_edit',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'label'           => esc_html__( 'About Content', 'hestia' ),
					'section'         => 'hestia_about',
					'priority'        => 14,
					'active_callback' => 'hestia_edited_with_pagebuilder',
				),
				'Hestia_PageBuilder_Button'
			)
		);
	}

	/**
	 * Add the background image control.
	 */
	private function add_background_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_feature_thumbnail',
				array(
					'sanitize_callback' => 'esc_url_raw',
					'default'           => get_template_directory_uri() . '/assets/img/contact.jpg',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'           => esc_html__( 'About background', 'hestia' ),
					'section'         => 'hestia_about',
					'priority'        => 15,
					'active_callback' => array( $this, 'is_static_page' ),
				),
				'WP_Customize_Image_Control'
			)
		);
	}

	/**
	 * Get default content for page editor control.
	 *
	 * @return string
	 */
	private function get_about_content_default() {
		$front_page_id = get_option( 'page_on_front' );
		if ( empty( $front_page_id ) ) {
			return '';
		}
		$content = get_post_field( 'post_content', $front_page_id );

		return $content;
	}

	/**
	 * Callback for About section content editor
	 *
	 * @return bool
	 */
	public function should_display_content_editor() {
		if ( 'page' === get_option( 'show_on_front' ) ) {
			return ! hestia_edited_with_pagebuilder();
		}

		return false;
	}

	/**
	 * About section content render callback.
	 */
	public function about_content_render_callback() {
		if ( have_posts() ) :
			while ( have_posts() ) :
				the_post();
				get_template_part( 'template-parts/content', 'frontpage' );
			endwhile;
		else : // I'm not sure it's possible to have no posts when this page is shown, but WTH
			get_template_part( 'template-parts/content', 'none' );
		endif;
	}

	/**
	 * Page editor control active callback function
	 *
	 * @return bool
	 */
	public function is_static_page() {
		return 'page' === get_option( 'show_on_front' );
	}
}
class-hestia-shop-controls.php000066600000003645151136072130012460 0ustar00<?php
/**
 * About controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_About_Controls
 */
class Hestia_Shop_Controls extends Hestia_Front_Page_Section_Controls_Abstract {

	/**
	 * Set the section data for generating the customizer basic settings
	 *
	 * @return array | null
	 */
	protected function set_section_data() {
		if ( ! class_exists( 'WooCommerce' ) ) {
			return null;
		}
		return array(
			'slug'     => 'shop',
			'title'    => esc_html__( 'Shop', 'hestia' ),
			'priority' => 20,
		);
	}

	/**
	 * Add controls.
	 */
	public function add_controls() {
		if ( ! class_exists( 'WooCommerce' ) ) {
			return;
		}
		$this->add_content_controls();
	}

	/**
	 * Add about section content editor control.
	 */
	private function add_content_controls() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_shop_items',
				array(
					'default'           => 4,
					'sanitize_callback' => 'absint',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Number of Items', 'hestia' ),
					'section'  => 'hestia_shop',
					'priority' => 15,
					'type'     => 'number',
				),
				null,
				array(
					'selector'            => '.hestia-shop .hestia-shop-content',
					'render_callback'     => array( $this, 'shop_content_render_callback' ),
					'container_inclusive' => true,
				)
			)
		);
	}

	/**
	 * Shop Content render callback
	 */
	public function shop_content_render_callback() {
		$shop_section = new Hestia_Shop_Section();
		$content      = $shop_section->shop_content();

		return $content;
	}

	/**
	 * Change necessary controls.
	 *
	 * @return void
	 */
	public function change_controls() {
		$this->change_customizer_object( 'setting', 'hestia_shop_title', 'default', esc_html__( 'Products', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_shop_subtitle', 'default', esc_html__( 'Change this subtitle in the Customizer', 'hestia' ) );
	}

}
class-hestia-contact-controls.php000066600000014367151136072130013145 0ustar00<?php
/**
 * Blog section controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Blog_Section_Controls
 */
class Hestia_Contact_Controls extends Hestia_Front_Page_Section_Controls_Abstract {

	/**
	 * Add section details
	 *
	 * @return array
	 */
	protected function set_section_data() {
		return array(
			'slug'     => 'contact',
			'title'    => esc_html__( 'Contact', 'hestia' ),
			'priority' => 65,
		);
	}

	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->add_tabs();
		$this->add_background_control();
		$this->add_form_title_control();
		$this->add_contact_info();
		$this->add_contact_content();
		$this->add_contact_shortcode();
	}

	/**
	 * Add tabs control
	 */
	private function add_tabs() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_tabs',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'section'  => 'hestia_contact',
					'priority' => 1,
					'tabs'     => array(
						'general' => array(
							'label' => esc_html__( 'General Settings', 'hestia' ),
							'icon'  => 'cogs',
						),
						'contact' => array(
							'label' => esc_html__( 'Contact Content', 'hestia' ),
							'icon'  => 'newspaper-o',
						),
					),
					'controls' => array(
						'general' => array(
							'hestia_contact_hide'       => array(),
							'hestia_contact_title'      => array(),
							'hestia_contact_subtitle'   => array(),
							'hestia_contact_background' => array(),
							'hestia_contact_area_title' => array(),
						),
						'contact' => array(
							'hestia_contact_info'        => array(),
							'hestia_contact_content_new' => array(),
							'hestia_contact_form_shortcode' => array(),
						),
					),
				),
				'Hestia_Customize_Control_Tabs'
			)
		);
	}

	/**
	 * Add control for the background image.
	 */
	private function add_background_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_background',
				array(
					'default'           => apply_filters( 'hestia_contact_background_default', get_template_directory_uri() . '/assets/img/contact.jpg' ),
					'sanitize_callback' => 'esc_url_raw',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Background Image', 'hestia' ),
					'section'  => 'hestia_contact',
					'priority' => 5,
				),
				'WP_Customize_Image_Control'
			)
		);
	}

	/**
	 * Add form title control.
	 */
	private function add_form_title_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_area_title', array(
					'default'           => esc_html__( 'Contact Us', 'hestia' ),
					'sanitize_callback' => 'sanitize_text_field',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Form Title', 'hestia' ),
					'section'  => 'hestia_contact',
					'priority' => 20,
				)
			)
		);
	}

	/**
	 * Add contact info.
	 */
	private function add_contact_info() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_info',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'label'      => esc_html__( 'Instructions', 'hestia' ),
					'section'    => 'hestia_contact',
					'capability' => 'install_plugins',
					'priority'   => 25,
				),
				'Hestia_Contact_Info'
			)
		);
	}

	/**
	 * Content control.
	 */
	private function add_contact_content() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_content_new',
				array(
					'default'           => wp_kses_post( $this->content_default() ),
					'sanitize_callback' => 'wp_kses_post',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'                      => esc_html__( 'Contact Content', 'hestia' ),
					'section'                    => 'hestia_contact',
					'priority'                   => 30,
					'include_admin_print_footer' => true,
				),
				'Hestia_Page_Editor',
				array(
					'selector'        => '.contactus .col-md-5 > div.hestia-description',
					'settings'        => 'hestia_contact_content_new',
					'render_callback' => array( $this, 'content_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add form shortcode control.
	 */
	private function add_contact_shortcode() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_form_shortcode',
				array(
					'default'           => '[pirate_forms]',
					'sanitize_callback' => 'sanitize_text_field',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Shortcode', 'hestia' ),
					'section'  => 'hestia_contact',
					'priority' => 26,
				),
				null,
				array(
					'selector'        => '.contactus .card-contact .content',
					'settings'        => 'hestia_contact_form_shortcode',
					'render_callback' => array( $this, 'form_render_callback' ),
				)
			)
		);
	}

	/**
	 * Get the contact content control default.
	 *
	 * @return string
	 */
	private function content_default() {
		$contact_section = new Hestia_Contact_Section();
		return $contact_section->content_default();
	}

	/**
	 * Render callback function for contact section content selective refresh
	 *
	 * @since 1.1.31
	 * @access public
	 * @return string
	 */
	public function content_render_callback() {
		return get_theme_mod( 'hestia_contact_content_new' );
	}

	/**
	 * Render callback function for contact form selective refresh
	 *
	 * @since 1.1.51
	 * @access public
	 * @return void
	 */
	public function form_render_callback() {
		$hestia_contact_form_shortcode_default = '[pirate_forms]';
		$hestia_contact_form_shortcode         = get_theme_mod( 'hestia_contact_form_shortcode', $hestia_contact_form_shortcode_default );

		if ( $hestia_contact_form_shortcode === $hestia_contact_form_shortcode_default || empty( $hestia_contact_form_shortcode ) ) {
			echo do_shortcode( '[pirate_forms]' );
		} else {
			echo do_shortcode( wp_kses_post( $hestia_contact_form_shortcode ) );
		}
	}

	/**
	 * Change necessary controls.
	 *
	 * @return void
	 */
	public function change_controls() {
		$this->change_customizer_object( 'setting', 'hestia_contact_title', 'default', esc_html__( 'Get in Touch', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_contact_subtitle', 'default', esc_html__( 'Change this subtitle in the Customizer', 'hestia' ) );
	}
}
class-hestia-big-title-controls.php000066600000030036151136072130013361 0ustar00<?php
/**
 * Big title controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Big_Title_Controls
 */
class Hestia_Big_Title_Controls extends Hestia_Register_Customizer_Controls {

	/**
	 * Initialize the control. Add all the hooks necessary.
	 */
	public function init() {
		parent::init();
		add_filter( 'customizer_widgets_section_args', array( $this, 'move_widgets_section' ), 10, 3 );
	}

	/**
	 * Filter to move widgets section to Fronptage section panel.
	 *
	 * @param array  $section_args Sections args.
	 * @param string $section_id Section id.
	 * @param string $sidebar_id Sidebar id.
	 *
	 * @return mixed
	 */
	public function move_widgets_section( $section_args, $section_id, $sidebar_id ) {
		if ( $sidebar_id === 'sidebar-big-title' ) {
			$section_args['panel'] = 'hestia_frontpage_sections';
		}
		return $section_args;
	}

	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->add_section_tabs();
		$this->add_general_controls();
		$this->add_background_image_control();
		$this->add_content_controls();
		$this->add_button_controls();
		$this->add_parallax_controls();
		$this->add_alignment_control();
	}

	/**
	 * Change controls.
	 */
	public function change_controls() {
		$this->maybe_add_defaults_for_big_title();
	}


	/**
	 * Add drop-down for header type.
	 */
	private function add_general_controls() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_slider_type',
				array(
					'sanitize_callback' => 'hestia_sanitize_big_title_type',
					'default'           => 'image',
				),
				array(
					'type'     => 'select',
					'priority' => -1,
					'section'  => 'sidebar-widgets-sidebar-big-title', // Add a default or your own section
					'label'    => esc_html__( 'Big Title Background', 'hestia' ),
					'choices'  => array(
						'image'    => esc_html__( 'Image', 'hestia' ),
						'parallax' => esc_html__( 'Parallax', 'hestia' ),
					),
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_widgets_title',
				array(
					'sanitize_callback' => 'wp_kses',
				),
				array(
					'label'    => esc_html__( 'Big Title Section', 'hestia' ) . ' ' . esc_html__( 'Sidebar', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => -1,
				),
				'Hestia_Customizer_Heading'
			)
		);

	}

	/**
	 * Add background control.
	 */
	public function add_background_image_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_background',
				array(
					'sanitize_callback' => 'esc_url_raw',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Image', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 10,
				),
				'WP_Customize_Image_Control',
				array(
					'selector'        => '.big-title-image',
					'settings'        => 'hestia_big_title_background',
					'render_callback' => array( $this, 'background_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add title subtitle.
	 */
	public function add_content_controls() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_title',
				array(
					'sanitize_callback' => 'wp_kses_post',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Title', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 20,
				),
				null,
				array(
					'selector'        => '.carousel .hestia-title',
					'settings'        => 'hestia_big_title_title',
					'render_callback' => array( $this, 'title_render_callback' ),
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_text',
				array(
					'sanitize_callback' => 'wp_kses_post',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Text', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 25,
				),
				null,
				array(
					'selector'        => '.carousel .sub-title',
					'settings'        => 'hestia_big_title_text',
					'render_callback' => array( $this, 'text_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add button controls.
	 */
	public function add_button_controls() {

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_button_text',
				array(
					'sanitize_callback' => 'sanitize_text_field',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Button text', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 30,
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_button_link',
				array(
					'sanitize_callback' => 'esc_url_raw',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Button URL', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 35,
				)
			)
		);

		$this->add_partial(
			new Hestia_Customizer_Partial(
				'hestia_big_title_button_text', array(
					'selector'        => '.carousel .buttons',
					'settings'        => 'hestia_big_title_button_text',
					'render_callback' => array( $this, 'button_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add alignment control.
	 */
	protected function add_alignment_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_slider_alignment',
				array(
					'default'           => 'center',
					'sanitize_callback' => 'hestia_sanitize_alignment_options',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Layout', 'hestia' ),
					'priority' => -2,
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'choices'  => array(
						'left'   => array(
							'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqBAMAAACsf7WzAAAAD1BMVEX////V1dUAhbo+yP/u9/pRM+FMAAAAZElEQVR42u3WsQ2AIBRFUd0AV3AFV3D/mSwsBI2BRIofPKchobjVK/7EQJZSit+az5/aq/WjVs99AQAjWxs8L4ZL0hqutTcoWt0OSa2orfdVaWl9b/XcqpbWvbXltLQCtwCA3AHhDKjAJvDMEwAAAABJRU5ErkJggg==',
						),
						'center' => array(
							'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqBAMAAACsf7WzAAAAD1BMVEX///8AhbrV1dU+yP/u9/q7NurVAAAAV0lEQVR42u3SsQ2AMAxFwYBYgA0QK7AC+89EQQOiIIoogn3XWHLxql8IZL1b+m+N5+ftaiVqfbkvACC8YW6iFbg17U0KCVQNTUvr0YK+bFdaWklaAPAXB4dWiADE72glAAAAAElFTkSuQmCC',
						),
						'right'  => array(
							'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqBAMAAACsf7WzAAAAD1BMVEX////V1dUAhbo+yP/u9/pRM+FMAAAAYElEQVR42u3SuQ2AMBBFQaAC3AIt0AL910RAAkICS1xrPJOstMGLfsOPpK0+fqtdPmdXq6LWnfsCAKJJe4+0hhxaVbWmHB9sVStCq7u8Ly2td7aqpXVsXNPSKrAFAOWbASNgr0b3Lh1kAAAAAElFTkSuQmCC',
						),
					),
				),
				'Hestia_Customize_Control_Radio_Image',
				array(
					'selector'        => '#carousel-hestia-generic',
					'settings'        => 'hestia_slider_alignment',
					'render_callback' => array( $this, 'alignment_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add controls for parallax.
	 */
	private function add_parallax_controls() {

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_parallax_layer1',
				array(
					'sanitize_callback' => 'esc_url_raw',
					'default'           => apply_filters( 'hestia_parallax_layer1_default', false ),
				),
				array(
					'label'    => esc_html__( 'First Layer', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 10,
				),
				'WP_Customize_Image_Control'
			)
		);
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_parallax_layer2',
				array(
					'sanitize_callback' => 'esc_url_raw',
					'default'           => apply_filters( 'hestia_parallax_layer2_default', false ),
				),
				array(
					'label'    => esc_html__( 'Second Layer', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 15,
				),
				'WP_Customize_Image_Control'
			)
		);
	}

	/**
	 * Add tabs control in hestia_big_title section.
	 */
	public function add_section_tabs() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_slider_tabs',
				array(
					'transport' => $this->selective_refresh,
				),
				array(
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => -3,
					'tabs'     => array(
						'slider' => array(
							'label' => esc_html__( 'Big Title Section', 'hestia' ),
							'icon'  => 'picture-o',
						),
						'extra'  => array(
							'label' => esc_html__( 'Extra', 'hestia' ),
							'icon'  => 'user-plus',
						),
					),
					'controls' => array(
						'slider' => array(
							'hestia_slider_type' => array(
								'image'    => array(
									'hestia_big_title_background',
									'hestia_big_title_title',
									'hestia_big_title_text',
									'hestia_big_title_button_text',
									'hestia_big_title_button_link',
								),
								'parallax' => array(
									'hestia_parallax_layer1',
									'hestia_parallax_layer2',
									'hestia_big_title_title',
									'hestia_big_title_text',
									'hestia_big_title_button_text',
									'hestia_big_title_button_link',

								),
							),
						),
						'extra'  => array(
							'hestia_slider_alignment' => array(
								'left'   => array(
									'hestia_big_title_widgets_title',
									'widgets',
								),
								'center' => array(),
								'right'  => array(
									'hestia_big_title_widgets_title',
									'widgets',
								),
							),
						),
					),
				),
				'Hestia_Customize_Control_Tabs'
			)
		);
	}


	/**
	 * Maybe throw in some defaults.
	 */
	private function maybe_add_defaults_for_big_title() {
		$hestia_slider_content = get_theme_mod( 'hestia_slider_content' );
		if ( ! empty( $hestia_slider_content ) ) {
			return;
		}

		$this->change_customizer_object( 'setting', 'hestia_big_title_background', 'default', esc_url( apply_filters( 'hestia_big_title_background_default', get_template_directory_uri() . '/assets/img/slider2.jpg' ) ) );
		$this->change_customizer_object( 'setting', 'hestia_big_title_title', 'default', esc_html__( 'Change in the Customizer', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_big_title_text', 'default', esc_html__( 'Change in the Customizer', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_big_title_button_text', 'default', esc_html__( 'Change in the Customizer', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_big_title_button_link', 'default', esc_url( '#' ) );
	}

	/**
	 * Callback for title.
	 *
	 * @return string
	 */
	public function title_render_callback() {
		return get_theme_mod( 'hestia_big_title_title' );
	}

	/**
	 * Callback for subtitle.
	 *
	 * @return string
	 */
	public function text_render_callback() {
		return get_theme_mod( 'hestia_big_title_text' );
	}

	/**
	 * Callback for button.
	 *
	 * @return bool|string
	 */
	public function button_render_callback() {
		$button_text = get_theme_mod( 'hestia_big_title_button_text' );
		$button_link = get_theme_mod( 'hestia_big_title_button_link' );
		if ( empty( $button_text ) ) {
			return false;
		}
		if ( empty( $button_link ) ) {
			return false;
		}

		$output = '<a href="' . $button_link . '" title="' . $button_text . '" class="btn btn-primary btn-lg">' . $button_text . '</a>';

		return wp_kses_post( $output );
	}

	/**
	 * Alignment callback.
	 */
	public function alignment_render_callback() {
		$big_title_section_view = new Hestia_Big_Title_Section();
		$big_title_section_view->render_big_title_content();
	}

	/**
	 * Background callback.
	 */
	public function background_render_callback() {
		$hestia_parallax_layer1 = get_theme_mod( 'hestia_parallax_layer1' );
		$hestia_parallax_layer2 = get_theme_mod( 'hestia_parallax_layer2' );
		if ( empty( $hestia_parallax_layer1 ) || empty( $hestia_parallax_layer2 ) ) {
			$hestia_big_title_background = get_theme_mod( 'hestia_big_title_background' );
			echo '<style class="big-title-image-css">';
			echo '#carousel-hestia-generic .header-filter {';
			echo ! empty( $hestia_big_title_background ) ? 'background-image: url("' . esc_url( $hestia_big_title_background ) . '") !important;' : 'background-image: none !important;';
			echo '}';
			echo '</style>';
		}
	}

}
class-hestia-subscribe-controls.php000066600000007313151136072130013464 0ustar00<?php
/**
 * Subscribe controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Subscribe_Controls
 */
class Hestia_Subscribe_Controls extends Hestia_Front_Page_Section_Controls_Abstract {

	/**
	 * Add section details
	 *
	 * @return array
	 */
	protected function set_section_data() {
		return array(
			'slug'             => 'subscribe',
			'title'            => esc_html__( 'Subscribe', 'hestia' ),
			'priority'         => 55,
			'initially_hidden' => true,
			'section'          => 'sidebar-widgets-subscribe-widgets',
		);

	}

	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->add_tabs();
		$this->add_info_control();
		$this->add_background_control();
	}

	/**
	 * Add section tabs/
	 */
	private function add_tabs() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_subscribe_tabs',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'section'  => 'sidebar-widgets-subscribe-widgets',
					'tabs'     => array(
						'general'    => array(
							'label' => esc_html__( 'General Settings', 'hestia' ),
						),
						'sendinblue' => array(
							'label' => esc_html__( 'SendinBlue plugin', 'hestia' ),
						),
					),
					'controls' => array(
						'general'    => array(
							'hestia_subscribe_hide'       => array(),
							'hestia_subscribe_background' => array(),
							'hestia_subscribe_title'      => array(),
							'hestia_subscribe_subtitle'   => array(),
						),
						'sendinblue' => array(
							'hestia_subscribe_info' => array(),
							'widgets'               => array(),
						),

					),
				),
				'Hestia_Customize_Control_Tabs'
			)
		);
	}

	/**
	 * Add background control.
	 */
	private function add_background_control() {

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_subscribe_background',
				array(
					'default'           => get_template_directory_uri() . '/assets/img/about.jpg',
					'sanitize_callback' => 'esc_url_raw',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Background Image', 'hestia' ),
					'section'  => 'sidebar-widgets-subscribe-widgets',
					'priority' => 10,
				),
				'WP_Customize_Image_Control'
			)
		);
	}

	/**
	 * Add the info control.
	 */
	private function add_info_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_subscribe_info',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'label'      => esc_html__( 'Instructions', 'hestia' ),
					'section'    => 'sidebar-widgets-subscribe-widgets',
					'capability' => 'install_plugins',
					'priority'   => 25,
				),
				'Hestia_Subscribe_Info'
			)
		);
	}

	/**
	 * Change any controls that may need change.
	 *
	 * @return void
	 */
	public function change_controls() {
		$this->change_customizer_object( 'section', 'sidebar-widgets-subscribe-widgets', 'panel', 'hestia_frontpage_sections' );
		$this->change_customizer_object( 'section', 'sidebar-widgets-subscribe-widgets', 'priority', apply_filters( 'hestia_section_priority', 55, 'sidebar-widgets-subscribe-widgets' ) );
		$this->change_customizer_object( 'setting', 'hestia_subscribe_title', 'default', esc_html__( 'Subscribe to our Newsletter', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_subscribe_subtitle', 'default', esc_html__( 'Change this subtitle in the Customizer', 'hestia' ) );
		$controls_to_move = array(
			'hestia_subscribe_subtitle',
			'hestia_subscribe_title',
			'hestia_subscribe_background',
			'hestia_subscribe_hide',
			'hestia_subscribe_info',
			'hestia_subscribe_tabs',
		);

		foreach ( $controls_to_move as $index => $control_id ) {
			$this->change_customizer_object( 'control', $control_id, 'priority', -$index );
		}
	}
}
class-hestia-blog-section-controls.php000066600000003454151136072130014072 0ustar00<?php
/**
 * Blog section controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Blog_Section_Controls
 */
class Hestia_Blog_Section_Controls extends Hestia_Front_Page_Section_Controls_Abstract {
	/**
	 * Implement set_section_data from parent.
	 * Add section details
	 *
	 * @return array
	 */
	protected function set_section_data() {
		return array(
			'slug'     => 'blog',
			'title'    => esc_html__( 'Blog', 'hestia' ),
			'priority' => 60,
		);
	}

	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->add_items_number_control();
	}

	/**
	 * Items number control.
	 */
	private function add_items_number_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_blog_items',
				array(
					'default'           => 3,
					'sanitize_callback' => 'absint',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'       => esc_html__( 'Number of Items', 'hestia' ),
					'section'     => 'hestia_blog',
					'priority'    => 15,
					'type'        => 'number',
					'input_attrs' => array(
						'min' => 1,
					),
				),
				null,
				array(
					'selector'        => '.hestia-blog-content',
					'settings'        => 'hestia_blog_items',
					'render_callback' => array( $this, 'blog_content_callback' ),
				)
			)
		);
	}

	/**
	 * Render callback function
	 */
	public function blog_content_callback() {
		$blog_section = new Hestia_Blog_Section();
		$blog_section->blog_content();
	}


	/**
	 * Change necessary controls.
	 *
	 * @return void
	 */
	public function change_controls() {
		$this->change_customizer_object( 'setting', 'hestia_blog_title', 'default', esc_html__( 'Blog', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_blog_subtitle', 'default', esc_html__( 'Change this subtitle in the Customizer', 'hestia' ) );
	}

}
class-hestia-contact-section.php000066600000022501151137564320012743 0ustar00<?php
/**
 * The Contact Section
 *
 * @package Hestia
 */

/**
 * Class Hestia_Contact_Section
 */
class Hestia_Contact_Section extends Hestia_Abstract_Main {
	/**
	 * Initialize section.
	 */
	public function init() {
		$this->hook_section();
	}

	/**
	 * Hook section in.
	 */
	private function hook_section() {
		$section_priority = apply_filters( 'hestia_section_priority', 65, 'hestia_contact' );
		add_action( 'hestia_sections', array( $this, 'do_section' ), absint( $section_priority ) );
		add_action( 'hestia_do_contact_section', array( $this, 'render_section' ) );
	}

	/**
	 * Executes the hook on which the content is rendered.
	 */
	public function do_section() {
		do_action( 'hestia_do_contact_section', false );
	}

	/**
	 * Contact section content.
	 * This function can be called from a shortcode too.
	 * When it's called as shortcode, the title and the subtitle shouldn't appear and it should be visible all the time,
	 * it shouldn't matter if is disable on front page.
	 *
	 * @since Hestia 1.0
	 * @modified 1.1.51
	 */
	function render_section( $is_shortcode = false ) {

		/**
		 * Don't show section if Disable section is checked.
		 * Show it if it's called as a shortcode.
		 */
		$hide_section  = get_theme_mod( 'hestia_contact_hide', false );
		$section_style = '';
		if ( $is_shortcode === false && (bool) $hide_section === true ) {
			if ( is_customize_preview() ) {
				$section_style .= 'display: none;';
			} else {
				return;
			}
		}

		/**
		 * Gather data to display the section.
		 */
		if ( current_user_can( 'edit_theme_options' ) ) {
			/* translators: 1 - link to customizer setting. 2 - 'customizer' */
			$hestia_contact_subtitle = get_theme_mod( 'hestia_contact_subtitle', sprintf( __( 'Change this subtitle in %s.', 'hestia' ), sprintf( '<a href="%1$s" class="default-link">%2$s</a>', esc_url( admin_url( 'customize.php?autofocus&#91;control&#93;=hestia_contact_subtitle' ) ), __( 'customizer', 'hestia' ) ) ) );
		} else {
			$hestia_contact_subtitle = get_theme_mod( 'hestia_contact_subtitle' );
		}
		$hestia_contact_title      = get_theme_mod( 'hestia_contact_title', esc_html__( 'Get in Touch', 'hestia' ) );
		$hestia_contact_area_title = get_theme_mod( 'hestia_contact_area_title', esc_html__( 'Contact Us', 'hestia' ) );

		$hestia_contact_background = get_theme_mod( 'hestia_contact_background', apply_filters( 'hestia_contact_background_default', get_template_directory_uri() . '/assets/img/contact.jpg' ) );
		if ( ! empty( $hestia_contact_background ) ) {
			$section_style .= 'background-image: url(' . esc_url( $hestia_contact_background ) . ');';
		}
		$section_style = 'style="' . $section_style . '"';

		/**
		 * In case this function is called as shortcode, we remove the container and we add 'is-shortcode' class.
		 */
		$class_to_add  = $is_shortcode === true ? 'is-shortcode' : '';
		$class_to_add .= ! empty( $hestia_contact_background ) ? 'section-image' : '';

		hestia_before_contact_section_trigger(); ?>
		<section class="hestia-contact contactus <?php echo esc_attr( $class_to_add ); ?>" id="contact"
				data-sorder="hestia_contact" <?php echo wp_kses_post( $section_style ); ?>>
			<?php
			hestia_before_contact_section_content_trigger();
			if ( $is_shortcode === false ) {
				hestia_display_customizer_shortcut( 'hestia_contact_hide', true );
			}
			?>
			<div class="container">
				<?php hestia_top_contact_section_content_trigger(); ?>
				<div class="row">
					<div class="col-md-5 hestia-contact-title-area" <?php echo hestia_add_animationation( 'fade-right' ); ?>>
						<?php
						hestia_display_customizer_shortcut( 'hestia_contact_title' );
						if ( ! empty( $hestia_contact_title ) || is_customize_preview() ) :
							?>
							<h2 class="hestia-title"><?php echo wp_kses_post( $hestia_contact_title ); ?></h2>
						<?php endif; ?>
						<?php if ( ! empty( $hestia_contact_subtitle ) || is_customize_preview() ) : ?>
							<h5 class="description"><?php echo hestia_sanitize_string( $hestia_contact_subtitle ); ?></h5>
						<?php endif; ?>
						<?php

						$contact_content_default = '';
						if ( current_user_can( 'edit_theme_options' ) ) {
							$contact_content_default = $this->content_default();
						}

						$hestia_contact_content = get_theme_mod( 'hestia_contact_content_new', wp_kses_post( $contact_content_default ) );
						if ( ! empty( $hestia_contact_content ) ) {
							echo '<div class="hestia-description">';
							echo wp_kses_post( force_balance_tags( $hestia_contact_content ) );
							echo '</div>';
						}

						?>
					</div>
					<?php
					$hestia_contact_form_shortcode_default = '[pirate_forms]';
					$hestia_contact_form_shortcode         = get_theme_mod( 'hestia_contact_form_shortcode', $hestia_contact_form_shortcode_default );
					if ( defined( 'PIRATE_FORMS_VERSION' ) || ( $hestia_contact_form_shortcode != $hestia_contact_form_shortcode_default ) ) {
						?>
						<div class="col-md-5 col-md-offset-2 hestia-contact-form-col" <?php echo hestia_add_animationation( 'fade-left' ); ?>>
							<div class="card card-contact">
								<?php if ( ! empty( $hestia_contact_area_title ) || is_customize_preview() ) : ?>
									<div class="header header-raised header-primary text-center">
										<h4 class="card-title"><?php echo esc_html( $hestia_contact_area_title ); ?></h4>
									</div>
								<?php endif; ?>
								<div class="content">
									<?php
									$this->render_contact_form();
									?>
								</div>
							</div>
						</div>
						<?php

					} elseif ( is_customize_preview() ) {
						$this->form_placeholder();
					}
					?>
				</div>
				<?php hestia_bottom_contact_section_content_trigger(); ?>
			</div>
			<?php hestia_after_contact_section_content_trigger(); ?>
		</section>
		<?php
		hestia_after_contact_section_trigger();
	}

	/**
	 * Get the contact default content
	 *
	 * @return string
	 */
	public function content_default() {
		$html = '<div class="hestia-info info info-horizontal">
			<div class="icon icon-primary">
				<i class="fa fa-map-marker"></i>
			</div>
			<div class="description">
				<h4 class="info-title"> Find us at the office </h4>
				<p>Bld Mihail Kogalniceanu, nr. 8,7652 Bucharest, Romania</p>
			</div>
		</div>
		<div class="hestia-info info info-horizontal">
			<div class="icon icon-primary">
				<i class="fa fa-mobile"></i>
			</div>
			<div class="description">
				<h4 class="info-title">Give us a ring</h4>
				<p>Michael Jordan <br> +40 762 321 762<br>Mon - Fri, 8:00-22:00</p>
			</div>
		</div>';

		return apply_filters( 'hestia_contact_content_default', $html );
	}

	/**
	 * Render contact form via shortcode input.
	 */
	private function render_contact_form() {
		$contact_form_shortcode = get_theme_mod( 'hestia_contact_form_shortcode', '[pirate_forms]' );

		if ( empty( $contact_form_shortcode ) ) {
			echo do_shortcode( '[pirate_forms]' );
			return;
		}

		echo do_shortcode( wp_kses_post( $contact_form_shortcode ) );
	}

	/**
	 * Render the contact form placeholder for the contact section.
	 *
	 * @since 1.1.31
	 * @access public
	 */
	private function form_placeholder() {
		echo '
<div class="col-md-5 col-md-offset-2 pirate-forms-placeholder">
    <div class="card card-contact">
        <div class="header header-raised header-primary text-center">
            <h4 class="hestia-title">' . esc_html__( 'Contact Us', 'hestia' ) . '</h4>
        </div>
        <div class="pirate-forms-placeholder-overlay">
        	<div class="pirate-forms-placeholder-align">
            	<h4 class="placeholder-text"> ' . esc_html__( 'In order to add a contact form to this section, you need to install the Pirate Forms plugin.', 'hestia' ) . ' </h4>
            </div>
		</div>
        <div class="content">
        	
	        <div class="pirate_forms_wrap">
	            <form class="pirate_forms ">
	                <div class="pirate_forms_three_inputs_wrap">
	                    <div class="col-sm-4 col-lg-4 form_field_wrap contact_name_wrap pirate_forms_three_inputs  ">
	                        <label for="pirate-forms-contact-name"></label>
					        <input id="pirate-forms-contact-name" class="form-control" type="text" value="" placeholder="Your Name">
                        </div>
                        <div class="col-sm-4 col-lg-4 form_field_wrap contact_email_wrap pirate_forms_three_inputs">
                            <label for="pirate-forms-contact-email"></label>
                            <input id="pirate-forms-contact-email" class="form-control" type="email" value="" placeholder="Your Email">
					    </div>
					    <div class="col-sm-4 col-lg-4 form_field_wrap contact_subject_wrap pirate_forms_three_inputs">
					        <label for="pirate-forms-contact-subject"></label>
					        <input id="pirate-forms-contact-subject" class="form-control" type="text" value="" placeholder="Subject">
                        </div>
                    </div>
                </form>
                <div class="col-sm-12 col-lg-12 form_field_wrap contact_message_wrap">
    					<textarea id="pirate-forms-contact-message" required="" class="form-control" placeholder="Your message"></textarea>
                    </div>
                <div class="col-xs-12 form_field_wrap contact_submit_wrap">
					    <button id="pirate-forms-contact-submit" class="pirate-forms-submit-button" type="submit">Send Message</button>
                    </div>
                <div class="pirate_forms_clearfix"></div>
            </div>
        </div>
    </div>
</div>';
	}
}
extendables/class-hestia-first-front-page-section.php000066600000007105151137564320017000 0ustar00<?php
/**
 * The manager for the first front page section.
 *
 * @package Hestia
 */

/**
 * Class Hestia_First_Front_Page_Section
 */
class Hestia_First_Front_Page_Section extends Hestia_Abstract_Main {

	/**
	 * Hook the section into the header.
	 */
	public function init() {
		add_action( 'hestia_header', array( $this, 'render_section' ) );
	}

	/**
	 * Big title section content.
	 *
	 * @since Hestia 1.0
	 */
	public function render_section() {
		hestia_before_big_title_section_trigger();
		?>
		<div id="carousel-hestia-generic" class="carousel slide" data-ride="carousel">
			<div class="carousel slide" data-ride="carousel">
				<div class="carousel-inner">
					<?php
					do_action( 'hestia_first_front_page_section_content' );
					?>
				</div>
			</div>
		</div>
		<?php
		hestia_after_big_title_section_trigger();
	}

	/**
	 * Display parallax.
	 *
	 * @since 1.1.72
	 */
	public function maybe_render_parallax() {
		if ( ! $this->should_display_parallax() ) {
			return;
		}

		$parallax_layer1 = get_theme_mod( 'hestia_parallax_layer1', apply_filters( 'hestia_parallax_layer1_default', false ) );
		$parallax_layer2 = get_theme_mod( 'hestia_parallax_layer2', apply_filters( 'hestia_parallax_layer2_default', false ) );

		echo '<div id="parallax_move">';
		echo '<div class="layer layer1" data-depth="0.10" style="background-image: url(' . esc_url( $parallax_layer1 ) . ');"></div>';
		echo '<div class="layer layer2" data-depth="0.20" style="background-image: url(' . esc_url( $parallax_layer2 ) . ');"></div>';
		echo '</div>';
	}

	/**
	 * Utility to check if we should display parallax.
	 */
	public static function should_display_parallax() {
		$hestia_big_title_type = get_theme_mod( 'hestia_slider_type', 'image' );
		if ( empty( $hestia_big_title_type ) || $hestia_big_title_type !== 'parallax' ) {
			return false;
		}

		$parallax_layer1 = get_theme_mod( 'hestia_parallax_layer1', apply_filters( 'hestia_parallax_layer1_default', false ) );
		if ( empty( $parallax_layer1 ) ) {
			return false;
		}

		$parallax_layer2 = get_theme_mod( 'hestia_parallax_layer2', apply_filters( 'hestia_parallax_layer2_default', false ) );
		if ( empty( $parallax_layer2 ) ) {
			return false;
		}

		return true;
	}

	/**
	 * Determine the classes that should be on widgets and slider content.
	 *
	 * @param string $slider_alignment Slider alignment.
	 *
	 * @return array
	 */
	public function get_big_title_elements_class( $slider_alignment ) {
		$result_array = array(
			'slide'  => ' big-title-slider-content text-' . $slider_alignment,
			'widget' => ' col-md-5 ',
		);

		switch ( $slider_alignment ) {
			case 'left':
				$result_array['slide']  .= ' col-md-7 ';
				$result_array['widget'] .= ' hestia-slider-alignment-left ';
				break;
			case 'center':
				$result_array['slide'] .= ' col-sm-8 col-sm-offset-2 ';
				break;
			case 'right':
				$result_array['slide']  .= ' col-md-7 margin-left-auto ';
				$result_array['widget'] .= ' hestia-slider-alignment-right ';
				break;
		}
		return $result_array;
	}

	/**
	 * Render widgets area on slider or big title.
	 *
	 * @param string $alignment Big title alignment.
	 * @param string $position Sidebar position.
	 * @param string $slide Slide index.
	 */
	public function maybe_render_widgets_area( $alignment, $position, $slide ) {
		if ( $alignment !== $position ) {
			return;
		}

		if ( $slide !== 1 ) {
			return;
		}

		$slider_elements_classes = $this->get_big_title_elements_class( $alignment );
		echo '<div class="big-title-sidebar-wrapper ' . esc_attr( $slider_elements_classes['widget'] ) . '">';
		dynamic_sidebar( 'sidebar-big-title' );
		echo '</div>';
	}
}
class-hestia-about-section.php000066600000004733151137564320012431 0ustar00<?php
/**
 * The About Section
 *
 * @package Hestia
 */

/**
 * Class Hestia_About_Section
 */
class Hestia_About_Section extends Hestia_Abstract_Main {
	/**
	 * Initialize About Section
	 */
	public function init() {
		$this->hook_section();
	}

	/**
	 * Hook section in.
	 */
	private function hook_section() {
		$section_priority = apply_filters( 'hestia_section_priority', 15, 'hestia_about' );
		add_action( 'hestia_sections', array( $this, 'do_section' ), absint( $section_priority ) );
		add_action( 'hestia_do_about_section', array( $this, 'render_section' ) );
	}

	/**
	 * Executes the hook on which the content is rendered.
	 */
	public function do_section() {
		do_action( 'hestia_do_about_section', false );
	}


	/**
	 * About section content.
	 *
	 * @since Hestia 1.0
	 * @modified 1.1.51
	 */
	public function render_section() {
		{

			/**
			 * Don't show section if Disable section is checked
			 */
			$section_style = '';
			$hide_section  = get_theme_mod( 'hestia_about_hide', false );
		if ( (bool) $hide_section === true ) {
			if ( is_customize_preview() ) {
				$section_style .= 'display: none;';
			} else {
				return;
			}
		}

			/**
			 * Display overlay (section-image class) on about section only if section have a background
			 */
			$class_to_add              = '';
			$hestia_frontpage_featured = get_theme_mod( 'hestia_feature_thumbnail', get_template_directory_uri() . '/assets/img/contact.jpg' );
		if ( ! empty( $hestia_frontpage_featured ) ) {
			$class_to_add   = 'section-image';
			$section_style .= 'background-image: url(\'' . esc_url( $hestia_frontpage_featured ) . '\');';
		}
			$section_style = 'style="' . $section_style . '"';

			hestia_before_about_section_trigger(); ?>
			<section class="hestia-about <?php echo esc_attr( $class_to_add ); ?>" id="about" data-sorder="hestia_about" <?php echo wp_kses_post( $section_style ); ?>>
				<?php hestia_display_customizer_shortcut( 'hestia_about_hide', true ); ?>
				<div class="container">
					<div class="row hestia-about-content">
						<?php
						// Show the selected frontpage content
						if ( have_posts() ) {
							while ( have_posts() ) {
								the_post();
								get_template_part( 'template-parts/content', 'frontpage' );
							}
						} else { // I'm not sure it's possible to have no posts when this page is shown, but WTH
							get_template_part( 'template-parts/content', 'none' );
						}
						?>
					</div>
				</div>
			</section>
			<?php
			hestia_after_about_section_trigger();
			}
	}
}
class-hestia-shop-section.php000066600000022770151137564320012271 0ustar00<?php
/**
 * The Features Section
 *
 * @package Hestia
 */

/**
 * Class Hestia_Features_Section
 */
class Hestia_Shop_Section extends Hestia_Abstract_Main {
	/**
	 * Initialize Shop Section
	 */
	public function init() {
		$this->hook_section();
	}

	/**
	 * Hook section in.
	 */
	private function hook_section() {
		$section_priority = apply_filters( 'hestia_section_priority', 20, 'hestia_shop' );
		add_action( 'hestia_sections', array( $this, 'do_section' ), absint( $section_priority ) );
		add_action( 'hestia_do_shop_section', array( $this, 'render_section' ) );
	}

	/**
	 * Executes the hook on which the content is rendered.
	 */
	public function do_section() {
		do_action( 'hestia_do_shop_section', false );
	}

	/**
	 * Shop section content.
	 *
	 * @since Hestia 1.0
	 * @modified 1.1.51
	 *
	 * @param bool $is_shortcode flag used if section is called via a shortcode.
	 */
	public function render_section( $is_shortcode = false ) {

		/**
		 * Don't show section if Disable section is checked or it doesn't have any content.
		 * Show it if it's called as a shortcode.
		 */
		$hide_section  = get_theme_mod( 'hestia_shop_hide', false );
		$section_style = '';
		if ( $is_shortcode === false && (bool) $hide_section === true ) {
			if ( is_customize_preview() ) {
				$section_style = 'style="display: none"';
			} else {
				return;
			}
		}

		if ( ! class_exists( 'WooCommerce' ) ) {
			return;
		}

			/**
			 * Gather data to display the section.
			 */
		if ( current_user_can( 'edit_theme_options' ) ) {
			/* translators: 1 - link to customizer setting. 2 - 'customizer' */
			$hestia_shop_subtitle = get_theme_mod( 'hestia_shop_subtitle', sprintf( __( 'Change this subtitle in %s.', 'hestia' ), sprintf( '<a href="%1$s" class="default-link">%2$s</a>', esc_url( admin_url( 'customize.php?autofocus&#91;control&#93;=hestia_shop_subtitle' ) ), __( 'customizer', 'hestia' ) ) ) );
		} else {
			$hestia_shop_subtitle = get_theme_mod( 'hestia_shop_subtitle' );
		}
			$hestia_shop_title = get_theme_mod( 'hestia_shop_title', esc_html__( 'Products', 'hestia' ) );

			/**
			 * In case this function is called as shortcode, we remove the container and we add 'is-shortcode' class.
			 */
			$wrapper_class   = $is_shortcode === true ? 'is-shortcode' : 'section-gray';
			$container_class = $is_shortcode === true ? '' : 'container';

			hestia_before_shop_section_trigger(); ?>
			<section class="hestia-shop products <?php echo esc_attr( $wrapper_class ); ?>" id="products"
					data-sorder="hestia_shop" <?php echo wp_kses_post( $section_style ); ?>>
				<?php
				hestia_before_shop_section_content_trigger();
				if ( $is_shortcode === false ) {
					hestia_display_customizer_shortcut( 'hestia_shop_hide', true );
				}
				?>
				<div class="<?php echo esc_attr( $container_class ); ?>">
					<?php
					hestia_top_shop_section_content_trigger();
					if ( $is_shortcode === false ) {
						?>
						<div class="row">
							<div class="col-md-8 col-md-offset-2 text-center hestia-shop-title-area">
								<?php
								hestia_display_customizer_shortcut( 'hestia_shop_title' );
								if ( ! empty( $hestia_shop_title ) || is_customize_preview() ) :
									?>
									<h2 class="hestia-title"><?php echo wp_kses_post( $hestia_shop_title ); ?></h2>
								<?php endif; ?>
								<?php if ( ! empty( $hestia_shop_subtitle ) || is_customize_preview() ) : ?>
									<h5 class="description"><?php echo hestia_sanitize_string( $hestia_shop_subtitle ); ?></h5>
								<?php endif; ?>
							</div>
						</div>
						<?php
					}
					$this->shop_content();
					hestia_bottom_shop_section_content_trigger();
					?>
				</div>
				<?php hestia_after_shop_section_content_trigger(); ?>
			</section>
			<?php
			hestia_after_shop_section_trigger();
	}

	/**
	 * Get content for shop section.
	 *
	 * @since 1.1.31
	 * @modified 1.1.45
	 * @access public
	 */
	public function shop_content() {
		?>
		<div class="hestia-shop-content">
			<?php
			$hestia_shop_shortcode = get_theme_mod( 'hestia_shop_shortcode' );
			if ( ! empty( $hestia_shop_shortcode ) ) {
				echo do_shortcode( $hestia_shop_shortcode );
				echo '</div>';
				return;
			}
			$hestia_shop_items = get_theme_mod( 'hestia_shop_items', 4 );

			$args                   = array(
				'post_type' => 'product',
			);
			$args['posts_per_page'] = ! empty( $hestia_shop_items ) ? absint( $hestia_shop_items ) : 4;

			/* Exclude hidden products from the loop */
			$args['tax_query'] = array(
				array(
					'taxonomy' => 'product_visibility',
					'field'    => 'name',
					'terms'    => 'exclude-from-catalog',
					'operator' => 'NOT IN',

				),
			);

			$hestia_shop_categories = get_theme_mod( 'hestia_shop_categories' );

			if ( ! empty( $hestia_shop_categories ) ) {
				array_push(
					$args['tax_query'],
					array(
						'taxonomy' => 'product_cat',
						'field'    => 'term_id',
						'terms'    => $hestia_shop_categories,
					)
				);
			}

			$hestia_shop_order = get_theme_mod( 'hestia_shop_order', 'DESC' );
			if ( ! empty( $hestia_shop_order ) ) {
				$args['order'] = $hestia_shop_order;
			}

			$loop = new WP_Query( $args );

			if ( $loop->have_posts() ) {
				$i = 1;
				echo '<div class="row"' . hestia_add_animationation( 'fade-up' ) . '>';
				while ( $loop->have_posts() ) {
					$loop->the_post();
					global $product;
					global $post;
					?>
					<div class="col-ms-6 col-sm-6 col-md-3 shop-item">
						<div class="card card-product">
							<?php
							$thumbnail = function_exists( 'woocommerce_get_product_thumbnail' ) ? woocommerce_get_product_thumbnail() : '';
							if ( empty( $thumbnail ) && function_exists( 'wc_placeholder_img' ) ) {
								$thumbnail = wc_placeholder_img();
							}
							if ( ! empty( $thumbnail ) ) {
								?>
								<div class="card-image">
									<a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php the_title_attribute(); ?>">
										<?php echo $thumbnail; ?>
									</a>
									<div class="ripple-container"></div>
								</div>
								<?php
							}
							?>
							<div class="content">
								<?php
								if ( function_exists( 'wc_get_product_category_list' ) ) {
									$prod_id            = get_the_ID();
									$product_categories = wc_get_product_category_list( $prod_id );
								} else {
									$product_categories = $product->get_categories();
								}

								if ( ! empty( $product_categories ) ) {
									/**
									 * Explode categories in words by ',' separator and show only the first 2. If the value is modified to -1 or lower in
									 * a function hooked at hestia_shop_category_words, then show all categories.
									 */
									$categories   = explode( ',', $product_categories );
									$nb_of_cat    = apply_filters( 'hestia_shop_category_words', 2 );
									$nb_of_cat    = intval( $nb_of_cat );
									$cat          = $nb_of_cat > -1 ? hestia_limit_content( $categories, $nb_of_cat, ',', false ) : $product_categories;
									$allowed_html = array(
										'a' => array(
											'href' => array(),
											'rel'  => array(),
										),
									);
									echo '<h6 class="category">';
									echo wp_kses( $cat, $allowed_html );
									echo '</h6>';
								}
								?>

								<h4 class="card-title">
									<?php
									/**
									 * Explode title in words by ' ' separator and show only the first 6 words. If the value is modified to -1 or lower in
									 * a function hooked at hestia_shop_title_words, then show the full title
									 */
									$title          = the_title( '', '', false );
									$title_in_words = explode( ' ', $title );
									$title_limit    = apply_filters( 'hestia_shop_title_words', -1 );
									$title_limit    = intval( $title_limit );
									$limited_title  = $title_limit > -1 ? hestia_limit_content( $title_in_words, $title_limit, ' ' ) : $title;
									?>
									<a class="shop-item-title-link" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php echo esc_html( $limited_title ); ?></a>

								</h4>

								<?php
								if ( $post->post_excerpt ) {
									/**
									 * Explode the excerpt in words by ' ' separator and show only the first 60 words. If the value is modified to -1 or lower in
									 * a function hooked at hestia_shop_excerpt_words, then use the normal behavior from woocommece ( show post excerpt )
									 */
									$excerpt_in_words = explode( ' ', $post->post_excerpt );
									$excerpt_limit    = apply_filters( 'hestia_shop_excerpt_words', 60 );
									$excerpt_limit    = intval( $excerpt_limit );
									$limited_excerpt  = $excerpt_limit > -1 ? hestia_limit_content( $excerpt_in_words, $excerpt_limit, ' ' ) : $post->post_excerpt;
									?>
									<div class="card-description"><?php echo wp_kses_post( apply_filters( 'woocommerce_short_description', $limited_excerpt ) ); ?></div>
									<?php
								}
								?>

								<div class="footer">

									<?php
									$product_price = $product->get_price_html();

									if ( ! empty( $product_price ) ) {

										echo '<div class="price"><h4>';

										echo wp_kses(
											$product_price, array(
												'span' => array(
													'class' => array(),
												),
												'del'  => array(),
											)
										);

										echo '</h4></div>';

									}
									?>

									<div class="stats">
										<?php hestia_add_to_cart(); ?>
									</div>
								</div>
							</div>
						</div>
					</div>
					<?php
					if ( $i % 4 == 0 ) {
						echo '</div><!-- /.row -->';
						echo '<div class="row">';
					}
					$i ++;
				}
				wp_reset_postdata();
				echo '</div>';
			}
			?>
		</div>
		<?php
	}
}
class-hestia-big-title-section.php000066600000016142151137564320013174 0ustar00<?php
/**
 * The Big title section handler.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Big_Title_Section
 */
class Hestia_Big_Title_Section extends Hestia_First_Front_Page_Section {

	/**
	 * Initialize the big title content.
	 */
	public function init() {
		parent::init();
		add_action( 'hestia_first_front_page_section_content', array( $this, 'render_big_title_content' ) );
	}

	/**
	 * Utility to check if we should display parallax.
	 * In hestia lite, hestia_slider_type control does not exist before refactor so we must check if both layers are not empty.
	 */
	public static function should_display_parallax() {
		$hestia_big_title_type = get_theme_mod( 'hestia_slider_type' );
		/**
		 * In hestia lite, hestia_slider_type control does not exist so we must check if both layers are not empty
		 */
		$parallax_layer1 = get_theme_mod( 'hestia_parallax_layer1', apply_filters( 'hestia_parallax_layer1_default', false ) );
		$parallax_layer2 = get_theme_mod( 'hestia_parallax_layer2', apply_filters( 'hestia_parallax_layer2_default', false ) );
		if ( empty( $hestia_big_title_type ) ) {
			if ( empty( $parallax_layer1 ) ) {
				return false;
			}
			if ( empty( $parallax_layer2 ) ) {
				return false;
			}
			/**
			 * Update slider type if hestia_slider_type in lite
			 */
			$should_update = get_option( 'update_slider_type' );
			if ( $should_update !== true ) {
				set_theme_mod( 'hestia_slider_type', 'parallax' );
				update_option( 'update_slider_type', true );
			}
		} else {
			if ( $hestia_big_title_type !== 'parallax' ) {
				return false;
			}
			if ( empty( $parallax_layer1 ) ) {
				return false;
			}
			if ( empty( $parallax_layer2 ) ) {
				return false;
			}
		}
		return true;
	}

	/**
	 * The main render function for this section.
	 */
	public function render_big_title_content() {
		$this->maybe_render_parallax();
		$this->render_content();
	}

	/**
	 * Render the big title content.
	 */
	public function render_content() {
		$section_content      = $this->get_big_title_content();
		$big_title_background = $this->get_big_title_background();

		if ( empty( $big_title_background ) && empty( $section_content ) ) {
			return;
		} ?>

		<div class="item active">
			<div class="page-header">
				<?php
				if ( is_customize_preview() ) {
					echo '<div class="big-title-image"></div>';
				}
				hestia_before_big_title_section_content_trigger();
				?>

				<div class="container">
					<?php hestia_top_big_title_section_content_trigger(); ?>
					<div class="row hestia-big-title-content">
						<?php $this->show_big_title_content( $section_content ); ?>
					</div>
					<?php hestia_bottom_big_title_section_content_trigger(); ?>
				</div><!-- /.container -->

				<div class="header-filter"
					<?php
					if ( ! empty( $big_title_background ) ) {
						echo 'style="background-image: url(' . esc_url( $big_title_background ) . ')"';
					}
					?>
				></div><!-- /.header-filter -->
				<?php hestia_after_big_title_section_content_trigger(); ?>
			</div><!-- /.page-header -->
		</div>
		<?php
	}

	/**
	 * Get the big title background.
	 *
	 * @return string
	 */
	protected function get_big_title_background() {
		$background = '';
		if ( ! $this->should_display_parallax() ) {
			$background = get_theme_mod( 'hestia_big_title_background', apply_filters( 'hestia_big_title_background_default', get_template_directory_uri() . '/assets/img/slider2.jpg' ) );
		}

		return $background;

	}

	/**
	 * Display big title section content.
	 *
	 * @param array $content Section settings.
	 *
	 * @since 1.1.41
	 */
	public function show_big_title_content( $content ) {

		$alignment               = get_theme_mod( 'hestia_slider_alignment', 'center' );
		$slider_elements_classes = $this->get_big_title_elements_class( $alignment );
		$this->maybe_render_widgets_area( $alignment, 'right', 1 );
		?>
		<div class="
		<?php
		if ( ! empty( $slider_elements_classes['slide'] ) ) {
			echo esc_attr( $slider_elements_classes['slide'] );
		}
		?>
		">
			<?php if ( ! empty( $content['title'] ) ) { ?>
				<h1 class="hestia-title"><?php echo wp_kses_post( $content['title'] ); ?></h1>
			<?php } ?>
			<?php if ( ! empty( $content['text'] ) ) { ?>
				<span class="sub-title"><?php echo wp_kses_post( $content['text'] ); ?></span>
			<?php } ?>
			<?php if ( ! empty( $content['button_link'] ) && ! empty( $content['button_text'] ) ) { ?>
				<div class="buttons">
					<a href="<?php echo esc_url( $content['button_link'] ); ?>"
							title="<?php echo esc_html( $content['button_text'] ); ?>"
							class="btn btn-primary btn-lg" <?php echo hestia_is_external_url( $content['button_link'] ); ?>><?php echo esc_html( $content['button_text'] ); ?></a>
					<?php hestia_big_title_section_buttons_trigger(); ?>
				</div>
			<?php } ?>
		</div>
		<?php
		$this->maybe_render_widgets_area( $alignment, 'left', 1 );
	}

	/**
	 * Get Big Title section content.
	 *
	 * @since 1.1.41
	 */
	public function get_big_title_content() {
		$section_content = array();

		$hestia_slider_alignment = get_theme_mod( 'hestia_slider_alignment', 'center' );
		$class_to_add            = ( ! empty( $hestia_slider_alignment ) ? 'text-' . $hestia_slider_alignment : 'text-center' );
		if ( ! empty( $class_to_add ) ) {
			$section_content['class_to_add'] = $class_to_add;
		}

		/* translators: 1 - link to customizer setting. 2 - 'customizer' */
		$title_default          = current_user_can( 'edit_theme_options' ) ? sprintf( esc_html__( 'Change in the %s', 'hestia' ), sprintf( '<a href="%1$s" class="default-link">%2$s</a>', esc_url( admin_url( 'customize.php?autofocus&#91;control&#93;=hestia_big_title_title' ) ), __( 'Customizer', 'hestia' ) ) ) : false;
		$hestia_big_title_title = get_theme_mod( 'hestia_big_title_title', $title_default );
		if ( ! empty( $hestia_big_title_title ) ) {
			$section_content['title'] = $hestia_big_title_title;
		}

		/* translators: 1 - link to customizer setting. 2 - 'customizer' */
		$text_default          = current_user_can( 'edit_theme_options' ) ? sprintf( esc_html__( 'Change in the %s', 'hestia' ), sprintf( '<a href="%1$s" class="default-link">%2$s</a>', esc_url( admin_url( 'customize.php?autofocus&#91;control&#93;=hestia_big_title_text' ) ), __( 'Customizer', 'hestia' ) ) ) : false;
		$hestia_big_title_text = get_theme_mod( 'hestia_big_title_text', $text_default );
		if ( ! empty( $hestia_big_title_text ) ) {
			$section_content['text'] = $hestia_big_title_text;
		}

		$button_text_default          = current_user_can( 'edit_theme_options' ) ? esc_html__( 'Change in the Customizer', 'hestia' ) : false;
		$hestia_big_title_button_text = get_theme_mod( 'hestia_big_title_button_text', $button_text_default );
		if ( ! empty( $hestia_big_title_button_text ) ) {
			$section_content['button_text'] = $hestia_big_title_button_text;
		}

		$button_link_default          = current_user_can( 'edit_theme_options' ) ? esc_url( admin_url( 'customize.php?autofocus&#91;control&#93;=hestia_big_title_button_text' ) ) : false;
		$hestia_big_title_button_link = get_theme_mod( 'hestia_big_title_button_link', $button_link_default );
		if ( ! empty( $hestia_big_title_button_link ) ) {
			$section_content['button_link'] = $hestia_big_title_button_link;
		}

		return $section_content;
	}
}
class-hestia-subscribe-section.php000066600000011010151137564320013262 0ustar00<?php
/**
 * The Subscribe Section
 *
 * @package Hestia
 */

/**
 * Class Hestia_Subscribe_Section
 */
class Hestia_Subscribe_Section extends Hestia_Abstract_Main {
	/**
	 * Initialize section.
	 */
	public function init() {
		$this->hook_section();
	}

	/**
	 * Hook section in.
	 */
	private function hook_section() {
		$old_priority     = apply_filters( 'hestia_section_priority', 55, 'hestia_subscribe' );
		$section_priority = apply_filters( 'hestia_section_priority', $old_priority, 'sidebar-widgets-subscribe-widgets' );
		add_action( 'hestia_sections', array( $this, 'do_section' ), absint( $section_priority ) );
		add_action( 'hestia_do_subscribe_section', array( $this, 'render_section' ) );
	}

	/**
	 * Executes the hook on which the content is rendered.
	 */
	public function do_section() {
		do_action( 'hestia_do_subscribe_section', false );
	}

	/**
	 * Subscribe section content.
	 *
	 * @since    Hestia 1.0
	 * @modified 1.1.51
	 *
	 * @param bool $is_shortcode flag used if section is called via a shortcode.
	 */
	function render_section( $is_shortcode = false ) {

		/**
		 * Don't show section if Disable section is checked.
		 * Show it if it's called as a shortcode.
		 */
		$hide_section  = get_theme_mod( 'hestia_subscribe_hide', true );
		$section_style = '';
		if ( $is_shortcode === false && (bool) $hide_section === true ) {
			if ( is_customize_preview() ) {
				$section_style .= 'display: none;';
			} else {
				return;
			}
		}

		/**
		 * Gather data to display the section.
		 */
		if ( current_user_can( 'edit_theme_options' ) ) {
			/* translators: 1 - link to customizer setting. 2 - 'customizer' */
			$hestia_subscribe_subtitle = get_theme_mod( 'hestia_subscribe_subtitle', sprintf( __( 'Change this subtitle in %s.', 'hestia' ), sprintf( '<a href="%1$s" class="default-link">%2$s</a>', esc_url( admin_url( 'customize.php?autofocus&#91;control&#93;=hestia_subscribe_subtitle' ) ), __( 'customizer', 'hestia' ) ) ) );
		} else {
			$hestia_subscribe_subtitle = get_theme_mod( 'hestia_subscribe_subtitle' );
		}
		$hestia_subscribe_title      = get_theme_mod( 'hestia_subscribe_title', __( 'Subscribe to our Newsletter', 'hestia' ) );
		$hestia_subscribe_background = get_theme_mod( 'hestia_subscribe_background', get_template_directory_uri() . '/assets/img/about.jpg' );
		if ( ! empty( $hestia_subscribe_background ) ) {
			$section_style .= 'background-image: url(' . esc_url( $hestia_subscribe_background ) . ');';
		}
		$section_style = 'style="' . esc_attr( $section_style ) . '"';

		/**
		 * In case this function is called as shortcode, we remove the container and we add 'is-shortcode' class.
		 */
		$class_to_add  = $is_shortcode === true ? 'is-shortcode ' : '';
		$class_to_add .= ! empty( $hestia_subscribe_background ) ? 'subscribe-line-image' : '';

		hestia_before_subscribe_section_trigger(); ?>
		<section class="hestia-subscribe subscribe-line <?php echo esc_attr( $class_to_add ); ?>" id="subscribe"
				data-sorder="hestia_subscribe" <?php echo wp_kses_post( $section_style ); ?>>
			<?php
			hestia_before_subscribe_section_content_trigger();
			if ( $is_shortcode === false ) {
				hestia_display_customizer_shortcut( 'hestia_subscribe_hide', true );
			}
			?>
			<div class="container">
				<?php hestia_top_subscribe_section_content_trigger(); ?>
				<div class="row text-center">
					<div class="col-md-8 col-md-offset-2 text-center hestia-subscribe-title-area">
						<?php
						hestia_display_customizer_shortcut( 'hestia_subscribe_title' );
						if ( ! empty( $hestia_subscribe_title ) || is_customize_preview() ) :
							?>
							<h2 class="title"><?php echo wp_kses_post( $hestia_subscribe_title ); ?></h2>
						<?php endif; ?>
						<?php if ( ! empty( $hestia_subscribe_subtitle ) || is_customize_preview() ) : ?>
							<h5 class="subscribe-description"><?php echo hestia_sanitize_string( $hestia_subscribe_subtitle ); ?></h5>
						<?php endif; ?>
					</div>
				</div>
				<?php if ( is_active_sidebar( 'subscribe-widgets' ) ) : ?>
					<div class="row">
						<div class="col-md-6 col-md-offset-3">
							<div class="card card-raised card-form-horizontal" <?php echo hestia_add_animationation( 'fade-down' ); ?>>
								<div class="content">
									<div class="row">
										<?php dynamic_sidebar( 'subscribe-widgets' ); ?>
									</div>
								</div>
							</div>
						</div>
					</div>
				<?php endif; ?>
				<?php hestia_bottom_subscribe_section_content_trigger(); ?>
			</div>
			<?php hestia_after_subscribe_section_content_trigger(); ?>
		</section>
		<?php
		hestia_after_subscribe_section_trigger();
	}

}
class-hestia-blog-section.php000066600000013425151137564320012240 0ustar00<?php
/**
 * The Blog Section
 *
 * @package Hestia
 */

/**
 * Class Hestia_Blog_Section
 */
class Hestia_Blog_Section extends Hestia_Abstract_Main {
	/**
	 * Initialize Blog Section
	 */
	public function init() {
		$this->hook_section();
	}

	/**
	 * Hook section in/
	 */
	private function hook_section() {
		$section_priority = apply_filters( 'hestia_section_priority', 60, 'hestia_blog' );
		add_action( 'hestia_sections', array( $this, 'do_section' ), absint( $section_priority ), 2 );
		add_action( 'hestia_do_blog_section', array( $this, 'render_section' ) );
	}

	/**
	 * Executes the hook on which the content is rendered.
	 */
	public function do_section() {
		do_action( 'hestia_do_blog_section', false );
	}

	/**
	 * Blog section content.
	 */
	public function render_section( $is_shortcode = false ) {

		/**
		 * Don't show section if Disable section is checked.
		 * Show it if it's called as a shortcode.
		 */
		$hide_section  = get_theme_mod( 'hestia_blog_hide', false );
		$section_style = '';
		if ( $is_shortcode === false && (bool) $hide_section === true ) {
			if ( is_customize_preview() ) {
				$section_style = 'style="display: none"';
			} else {
				return;
			}
		}

		/**
		 * Gather data to display the section.
		 */
		if ( current_user_can( 'edit_theme_options' ) ) {
			/* translators: 1 - link to customizer setting. 2 - 'customizer' */
			$hestia_blog_subtitle = get_theme_mod( 'hestia_blog_subtitle', sprintf( __( 'Change this subtitle in the %s.', 'hestia' ), sprintf( '<a href="%1$s" class="default-link">%2$s</a>', esc_url( admin_url( 'customize.php?autofocus&#91;control&#93;=hestia_blog_subtitle' ) ), __( 'Customizer', 'hestia' ) ) ) );
		} else {
			$hestia_blog_subtitle = get_theme_mod( 'hestia_blog_subtitle' );
		}
		$hestia_blog_title = get_theme_mod( 'hestia_blog_title', __( 'Blog', 'hestia' ) );
		if ( $is_shortcode ) {
			$hestia_blog_title    = '';
			$hestia_blog_subtitle = '';
		}

		/**
		 * In case this function is called as shortcode, we remove the container and we add 'is-shortcode' class.
		 */
		$wrapper_class   = $is_shortcode === true ? 'is-shortcode' : '';
		$container_class = $is_shortcode === true ? '' : 'container';

		hestia_before_blog_section_trigger(); ?>
		<section class="hestia-blogs <?php echo esc_attr( $wrapper_class ); ?>" id="blog"
			data-sorder="hestia_blog" <?php echo wp_kses_post( $section_style ); ?>>
			<?php
			hestia_before_blog_section_content_trigger();
			if ( $is_shortcode === false ) {
				hestia_display_customizer_shortcut( 'hestia_blog_hide', true );
			}
			?>
			<div class="<?php echo esc_attr( $container_class ); ?>">
				<?php
				hestia_top_blog_section_content_trigger();
				if ( $is_shortcode === false ) {
					?>
					<div class="row">
						<div class="col-md-8 col-md-offset-2 text-center hestia-blogs-title-area">
							<?php
							hestia_display_customizer_shortcut( 'hestia_blog_title' );
							if ( ! empty( $hestia_blog_title ) || is_customize_preview() ) {
								echo '<h2 class="hestia-title">' . wp_kses_post( $hestia_blog_title ) . '</h2>';
							}
							if ( ! empty( $hestia_blog_subtitle ) || is_customize_preview() ) {
								echo '<h5 class="description">' . hestia_sanitize_string( $hestia_blog_subtitle ) . '</h5>';
							}
							?>
						</div>
					</div>
					<?php
				}
				?>
				<div class="hestia-blog-content">
				<?php
				$this->blog_content();
				?>
				</div>
				<?php hestia_bottom_blog_section_content_trigger(); ?>
			</div>
			<?php hestia_after_blog_section_content_trigger(); ?>
		</section>
		<?php
		hestia_after_blog_section_trigger();
	}

	/**
	 * Blog content/
	 */
	public function blog_content() {

		$hestia_blog_items      = get_theme_mod( 'hestia_blog_items', 3 );
		$args                   = array(
			'ignore_sticky_posts' => true,
		);
		$args['posts_per_page'] = ! empty( $hestia_blog_items ) ? absint( $hestia_blog_items ) : 3;

		$hestia_blog_categories = get_theme_mod( 'hestia_blog_categories' );

		if ( ! empty( $hestia_blog_categories[0] ) && sizeof( $hestia_blog_categories ) >= 1 ) {
			$args['tax_query'] = array(
				array(
					'taxonomy' => 'category',
					'field'    => 'term_id',
					'terms'    => $hestia_blog_categories,
				),
			);
		}

		$loop = new WP_Query( $args );

		$allowed_html = array(
			'br'     => array(),
			'em'     => array(),
			'strong' => array(),
			'i'      => array(
				'class' => array(),
			),
			'span'   => array(),
		);

		if ( ! $loop->have_posts() ) {
			return;
		}
			$i = 1;
			echo '<div class="row" ' . hestia_add_animationation( 'fade-up' ) . '>';
		while ( $loop->have_posts() ) :
			$loop->the_post();
			?>
			<article class="col-xs-12 col-ms-10 col-ms-offset-1 col-sm-8 col-sm-offset-2 <?php echo esc_attr( apply_filters( 'hestia_blog_per_row_class', 'col-md-4' ) ); ?> hestia-blog-item">
				<div class="card card-plain card-blog">
					<?php if ( has_post_thumbnail() ) : ?>
							<div class="card-image">
								<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
									<?php the_post_thumbnail( 'hestia-blog' ); ?>
								</a>
							</div>
						<?php endif; ?>
					<div class="content">
						<h6 class="category"><?php hestia_category(); ?></h6>
						<h4 class="card-title">
							<a class="blog-item-title-link" href="<?php echo esc_url( get_permalink() ); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark">
								<?php echo wp_kses( force_balance_tags( get_the_title() ), $allowed_html ); ?>
							</a>
						</h4>
						<p class="card-description"><?php echo wp_kses_post( get_the_excerpt() ); ?></p>
					</div>
				</div>
				</article>
				<?php
				if ( $i % apply_filters( 'hestia_blog_per_row_no', 3 ) == 0 ) {
					echo '</div><!-- /.row -->';
					echo '<div class="row" ' . hestia_add_animationation( 'fade-up' ) . '>';
				}
				$i++;
			endwhile;
			echo '</div>';

			wp_reset_postdata();
	}

}