&lt;?php
define(&#039;PENCI_SOLEDAD_VERSION&#039;, &#039;8.7.5&#039;);
if ( ! defined( &#039;PENCI_SOLEDAD_DIR&#039; ) ) {
	define(&#039;PENCI_SOLEDAD_DIR&#039;, get_template_directory() );
}
if ( ! defined( &#039;PENCI_SOLEDAD_URL&#039; ) ) {
	define(&#039;PENCI_SOLEDAD_URL&#039;, get_template_directory_uri() );
}

add_filter(&#039;pre_http_request&#039;, function($pre, $args, $url) {
	if (strpos($url, &#039;license.pencidesign.net&#039;) !== false) {
		return array(
			&#039;headers&#039;  =&gt; array(),
			&#039;body&#039;     =&gt; json_encode(array(
				&#039;status&#039; =&gt; &#039;success&#039;,
				&#039;data&#039;   =&gt; (object) array(
					&#039;buyer&#039;           =&gt; &#039;licensee&#039;,
					&#039;sold_at&#039;         =&gt; &#039;2024-01-01T00:00:00+00:00&#039;,
					&#039;supported_until&#039; =&gt; &#039;2099-12-31T00:00:00+00:00&#039;,
					&#039;purchase_count&#039;  =&gt; 1,
					&#039;amount&#039;          =&gt; &#039;59&#039;,
				),
			)),
			&#039;response&#039; =&gt; array(&#039;code&#039; =&gt; 200, &#039;message&#039; =&gt; &#039;OK&#039;),
			&#039;cookies&#039;  =&gt; array(),
			&#039;filename&#039; =&gt; &#039;&#039;,
		);
	}
	return $pre;
}, 10, 3);

add_action(&#039;after_setup_theme&#039;, function() {
	$_pcd = array(
        &#039;purchase_code&#039;  =&gt; &#039;b5e0b5f8-dd86-89e6-aca4-9dd6e6e1a930&#039;,
		&#039;buyer&#039;          =&gt; &#039;licensee&#039;,
		&#039;bount_time&#039;     =&gt; &#039;2024-01-01 00:00:00&#039;,
		&#039;support_to&#039;     =&gt; &#039;2099-12-31 00:00:00&#039;,
		&#039;purchase_count&#039; =&gt; 1,
		&#039;amount&#039;         =&gt; &#039;59&#039;,
		&#039;time_notice&#039;    =&gt; strtotime(&#039;+30 days&#039;),
	);
	$_fn = function() use ($_pcd) {
		update_option(&#039;penci_soledad_is_activated&#039;, 1);
		update_option(&#039;penci_soledad_purchased_data&#039;, $_pcd);
		update_option(&#039;penci_validate_check&#039;, strtotime(&#039;+30 days&#039;));
		update_option(&#039;penci_loads_cm&#039;, &#039;load&#039;);
	};
	if (is_multisite()) {
		global $wpdb;
		foreach ($wpdb-&gt;get_col(&quot;SELECT blog_id FROM {$wpdb-&gt;blogs}&quot;) as $bid) {
			switch_to_blog($bid);
			$_fn();
			restore_current_blog();
		}
	} else {
		$_fn();
	}
}, 1);

/**
 * Global content width
 *
 * @param $content_width
 *
 * @return void
 *@since 1.0
 */
if (!isset($content_width)) {
	$content_width = 1170;
}

add_action( &#039;init&#039;, function() {
	// Localization support since 6.6
	load_theme_textdomain(&#039;soledad&#039;, PENCI_SOLEDAD_DIR . &#039;/languages&#039;);
	load_theme_textdomain(&#039;soledad&#039;, WP_LANG_DIR . &#039;/themes&#039;); // since: WordPress 6.7
} );

/**
 * Theme setup
 * Hook to action after_setup_theme
 *
 * @return void
 *@since 1.0
 */
add_action(&#039;after_setup_theme&#039;, &#039;penci_soledad_theme_setup&#039;);
if (!function_exists(&#039;penci_soledad_theme_setup&#039;)) {
	function penci_soledad_theme_setup() {

		add_theme_support( &#039;editor-styles&#039; );

		// This theme styles the visual editor with editor-style.css to match the theme style.
		add_editor_style();

		add_editor_style( &#039;css/penci-icon.min.css&#039; );

		$fontawesome_ver5 = get_theme_mod(&#039;penci_fontawesome_ver5&#039;);
		if ($fontawesome_ver5) {
			add_editor_style( &#039;css/font-awesome.5.11.2.min.css&#039; );
		}

		// Register navigation menu
		register_nav_menus(
			array(
				&#039;main-menu&#039; =&gt; &#039;Primary Menu&#039;,
				&#039;topbar-menu&#039; =&gt; &#039;Topbar Menu&#039;,
				&#039;footer-menu&#039; =&gt; &#039;Footer Menu&#039;,
				&#039;user-menu&#039; =&gt; &#039;User Menu&#039;,
			)
		);
		
		// Feed Links
		add_theme_support(&#039;automatic-feed-links&#039;);

		// Title tag
		add_theme_support(&#039;title-tag&#039;);

		// Post formats - we support 4 post format: standard, gallery, video and audio
		add_theme_support(&#039;post-formats&#039;, array(&#039;standard&#039;, &#039;gallery&#039;, &#039;video&#039;, &#039;audio&#039;, &#039;link&#039;, &#039;quote&#039;));

		// Add support for Block Styles.
		add_theme_support(&#039;wp-block-styles&#039;);

		// Add support for full and wide align images.
		add_theme_support(&#039;align-wide&#039;);

		// Add support for widget block editor
		add_theme_support(&#039;widgets-block-editor&#039;);

		// Add custom editor font sizes.
		add_theme_support(
			&#039;editor-font-sizes&#039;,
			array(
				array(
					&#039;name&#039; =&gt; __(&#039;Small&#039;, &#039;soledad&#039;),
					&#039;shortName&#039; =&gt; __(&#039;S&#039;, &#039;soledad&#039;),
					&#039;size&#039; =&gt; 12,
					&#039;slug&#039; =&gt; &#039;small&#039;,
				),
				array(
					&#039;name&#039; =&gt; __(&#039;Normal&#039;, &#039;soledad&#039;),
					&#039;shortName&#039; =&gt; __(&#039;N&#039;, &#039;soledad&#039;),
					&#039;size&#039; =&gt; 14,
					&#039;slug&#039; =&gt; &#039;normal&#039;,
				),
				array(
					&#039;name&#039; =&gt; __(&#039;Medium&#039;, &#039;soledad&#039;),
					&#039;shortName&#039; =&gt; __(&#039;M&#039;, &#039;soledad&#039;),
					&#039;size&#039; =&gt; 20,
					&#039;slug&#039; =&gt; &#039;medium&#039;,
				),
				array(
					&#039;name&#039; =&gt; __(&#039;Large&#039;, &#039;soledad&#039;),
					&#039;shortName&#039; =&gt; __(&#039;L&#039;, &#039;soledad&#039;),
					&#039;size&#039; =&gt; 32,
					&#039;slug&#039; =&gt; &#039;large&#039;,
				),
				array(
					&#039;name&#039; =&gt; __(&#039;Huge&#039;, &#039;soledad&#039;),
					&#039;shortName&#039; =&gt; __(&#039;XL&#039;, &#039;soledad&#039;),
					&#039;size&#039; =&gt; 42,
					&#039;slug&#039; =&gt; &#039;huge&#039;,
				),
			)
		);

		// Post thumbnails
		add_theme_support(&#039;post-thumbnails&#039;);
		$penci_image_sizes = [
			&#039;penci_dthumb_1920_auto&#039;  =&gt; [ &#039;penci-single-full&#039;, 1920, 0, false ],
			&#039;penci_dthumb_1920_800&#039;   =&gt; [ &#039;penci-slider-full-thumb&#039;, 1920, 800, true ],
			&#039;penci_dthumb_1170_auto&#039;  =&gt; [ &#039;penci-full-thumb&#039;, 1170, 99999, false ],
			&#039;penci_dthumb_1170_663&#039;   =&gt; [ &#039;penci-slider-thumb&#039;, 1170, 663, true ],
			&#039;penci_dthumb_780_516&#039;    =&gt; [ &#039;penci-magazine-slider&#039;, 780, 516, true ],
			&#039;penci_dthumb_585_390&#039;    =&gt; [ &#039;penci-thumb&#039;, 585, 390, true ],
			&#039;penci_dthumb_585_auto&#039;   =&gt; [ &#039;penci-masonry-thumb&#039;, 585, 99999, false ],
			&#039;penci_dthumb_585_585&#039;    =&gt; [ &#039;penci-thumb-square&#039;, 585, 585, true ],
			&#039;penci_dthumb_480_650&#039;    =&gt; [ &#039;penci-thumb-vertical&#039;, 480, 650, true ],
			&#039;penci_dthumb_263_175&#039;    =&gt; [ &#039;penci-thumb-small&#039;, 263, 175, true ],
		];

		$penci_image_sizes = apply_filters( &#039;penci_image_sizes&#039;, $penci_image_sizes );
	
		foreach ( $penci_image_sizes as $theme_mod =&gt; $args ) {
			if ( ! get_theme_mod( $theme_mod ) ) {
				add_image_size( ...$args );
			}
		}
	}
}

if (!function_exists(&#039;penci_locate_template&#039;)) {
	function penci_locate_template( $template_names ) {
		
		$wp_stylesheet_path = get_stylesheet_directory();
		$wp_template_path   = get_template_directory();

		$is_child_theme = is_child_theme();

		$located = &#039;&#039;;
		foreach ( (array) $template_names as $template_name ) {
			if ( ! $template_name ) {
				continue;
			}
			if ( file_exists( $wp_stylesheet_path . &#039;/&#039; . $template_name ) ) {
				$located = $wp_stylesheet_path . &#039;/&#039; . $template_name;
				break;
			} elseif ( $is_child_theme &amp;&amp; file_exists( $wp_template_path . &#039;/&#039; . $template_name ) ) {
				$located = $wp_template_path . &#039;/&#039; . $template_name;
				break;
			} elseif ( file_exists( ABSPATH . WPINC . &#039;/theme-compat/&#039; . $template_name ) ) {
				$located = ABSPATH . WPINC . &#039;/theme-compat/&#039; . $template_name;
				break;
			}
		}
		return $located;
	}
}

if ( ! function_exists( &#039;penci_generator_tag&#039;) ) {
	add_filter( &#039;get_the_generator_html&#039;, &#039;penci_generator_tag&#039;, 10, 2 );
	add_filter( &#039;get_the_generator_xhtml&#039;, &#039;penci_generator_tag&#039;, 10, 2 );
	function penci_generator_tag( $gen, $type ) {
		switch ( $type ) {
			case &#039;html&#039;:
				$gen .= &quot;\n&quot; . &#039;&lt;meta name=&quot;generator&quot; content=&quot;Soledad &#039; . esc_attr( PENCI_SOLEDAD_VERSION ) . &#039;&quot;&gt;&#039;;
				break;
			case &#039;xhtml&#039;:
				$gen .= &quot;\n&quot; . &#039;&lt;meta name=&quot;generator&quot; content=&quot;Soledad &#039; . esc_attr( PENCI_SOLEDAD_VERSION ) . &#039;&quot; /&gt;&#039;;
				break;
		}
		return $gen;
	}
}

/**
 * Enqueue styles/scripts
 * Hook to action wp_enqueue_scripts
 *
 * @return void
 *@since 1.0
 */
if (!function_exists(&#039;penci_load_scripts&#039;)) {
	add_action(&#039;wp_enqueue_scripts&#039;, &#039;penci_load_scripts&#039;);
	function penci_load_scripts() {

		$is_enable_rest = get_theme_mod(&#039;penci_handle_ajax_with_rest_api&#039;);

		$search_multi_text = get_theme_mod( &#039;penci_trans_type_and_hit_multi&#039; );
		$search_multi_text_arr = array_map( &#039;trim&#039;, explode( &quot;\n&quot;, $search_multi_text ) );

		$localize_script = array(
			&#039;url&#039; =&gt; admin_url(&#039;admin-ajax.php&#039;),
			&#039;megamenu_url&#039; =&gt; $is_enable_rest ? esc_url(rest_url(&#039;penci/v1/penci_html_mega_menu&#039;)) : esc_url(admin_url(&#039;admin-ajax.php&#039;)),
			&#039;archive_more_url&#039; =&gt; $is_enable_rest ? esc_url(rest_url(&#039;penci/v1/penci_archive_more_post&#039;)) : esc_url(admin_url(&#039;admin-ajax.php&#039;)),
			&#039;nonce&#039; =&gt; wp_create_nonce(&#039;ajax-nonce&#039;),
			&#039;wp_rest&#039;    =&gt; wp_create_nonce( &#039;wp_rest&#039; ),
			&#039;errorPass&#039; =&gt; &#039;&lt;p class=&quot;message message-error&quot;&gt;&#039; . penci_get_setting(&#039;penci_plogin_mess_error_email_pass&#039;) . &#039;&lt;/p&gt;&#039;,
			&#039;login&#039; =&gt; penci_get_setting(&#039;penci_plogin_email_place&#039;),
			&#039;more&#039; =&gt; penci_get_setting(&#039;penci_trans_read_more&#039;),
			&#039;password&#039; =&gt; penci_get_setting(&#039;penci_trans_pass_text&#039;),
			&#039;headerstyle&#039; =&gt; get_theme_mod(&#039;penci_topbar_search_style&#039;, &#039;default&#039;),
			&#039;reading_bar_pos&#039; =&gt; get_theme_mod(&#039;penci_reading_bar_pos&#039;, &#039;footer&#039;),
			&#039;reading_bar_h&#039; =&gt; get_theme_mod(&#039;penci_reading_bar_h&#039;, 5),
			&#039;carousel_e&#039; =&gt; get_theme_mod(&#039;penci_carousel_slider_effect&#039;, &#039;swing&#039;),
			&#039;slider_e&#039; =&gt; get_theme_mod(&#039;penci_single_slider_effect&#039;, &#039;creative&#039;),
			&#039;fcarousel_e&#039; =&gt; get_theme_mod(&#039;penci_fslider_carousel_slider_effect&#039;, &#039;swing&#039;),
			&#039;fslider_e&#039; =&gt; get_theme_mod(&#039;penci_fslider_single_slider_effect&#039;, &#039;creative&#039;),
			&#039;vfloat&#039; =&gt; get_theme_mod(&#039;penci_video_float&#039;),
			&#039;vfloatp&#039; =&gt; get_theme_mod(&#039;penci_video_float_position&#039;,&#039;bottom-right&#039;),
			&#039;redirect_url&#039; =&gt; get_theme_mod(&#039;penci_tblogin_redirect_url&#039;),
			&#039;search_multi&#039; =&gt; (bool) $search_multi_text,
			&#039;search_multi_txt&#039; =&gt; $search_multi_text_arr,
			&#039;rest_url&#039; =&gt; esc_url( rest_url() ),
		);

		$localize_script = apply_filters( &#039;penci_localize_script&#039;, $localize_script );

        $media_fonts = &#039;&#039;;

        if (penci_mobile_fonts_url()) {
            $media_fonts = &#039;only screen and (min-width: 768px)&#039;;
			wp_register_style(&#039;penci-mobile-fonts&#039;, penci_mobile_fonts_url(), array(), PENCI_SOLEDAD_VERSION,&#039;only screen and (max-width: 768px)&#039;);
		}

		if (penci_fonts_url()) {
			wp_register_style(&#039;penci-fonts&#039;, penci_fonts_url(), array(), PENCI_SOLEDAD_VERSION, $media_fonts);
		}

		// Enqueue style
		if (!get_theme_mod(&#039;penci_disable_default_fonts&#039;)) {
			if (penci_fonts_url()) {
				wp_enqueue_style(&#039;penci-fonts&#039;);
			}
            if (penci_mobile_fonts_url()) {
				wp_enqueue_style(&#039;penci-mobile-fonts&#039;);
			}
		}

		wp_enqueue_style(&#039;penci-main-style&#039;, PENCI_SOLEDAD_URL . &#039;/main.css&#039;, array(), PENCI_SOLEDAD_VERSION);

		if ( is_customize_preview() ) {
			wp_enqueue_style(&#039;penci-customizer-edit&#039;, PENCI_SOLEDAD_URL . &#039;/css/customizer-edit.css&#039;, array(), PENCI_SOLEDAD_VERSION);
		}

		wp_enqueue_style(&#039;penci-swiper-bundle&#039;, PENCI_SOLEDAD_URL . &#039;/css/swiper-bundle.min.css&#039;, array(), PENCI_SOLEDAD_VERSION);

		if (class_exists(&#039;bbPress&#039;) || class_exists(&#039;BuddyPress&#039;)) {
			wp_enqueue_style(&#039;penci-buddypress-bbpress&#039;, PENCI_SOLEDAD_URL . &#039;/css/buddypress-bbpress.min.css&#039;, array(), PENCI_SOLEDAD_VERSION);
		}

		wp_enqueue_style(&#039;penci-font-awesomeold&#039;, PENCI_SOLEDAD_URL . &#039;/css/font-awesome.4.7.0.swap.min.css&#039;, array(), &#039;4.7.0&#039;);

		wp_register_style(&#039;penci-font-iweather&#039;, PENCI_SOLEDAD_URL . &#039;/css/weather-icon.swap.css&#039;, array(), &#039;2.0&#039;);

		$fontawesome_ver5 = penci_get_setting(&#039;penci_fontawesome_ver5&#039;);
		if ($fontawesome_ver5) {
			wp_enqueue_style(&#039;penci-font-awesome&#039;, PENCI_SOLEDAD_URL . &#039;/css/font-awesome.5.11.2.swap.min.css&#039;, array(), &#039;5.11.2&#039;);
		}
		wp_enqueue_style(&#039;penci_icon&#039;, PENCI_SOLEDAD_URL . &#039;/css/penci-icon.min.css&#039;, array(), PENCI_SOLEDAD_VERSION);

		wp_enqueue_style(&#039;penci_style&#039;, get_stylesheet_directory_uri() . &#039;/style.css&#039;, array(), PENCI_SOLEDAD_VERSION);

		wp_enqueue_style(&#039;penci_social_counter&#039;, PENCI_SOLEDAD_URL . &#039;/css/social-counter.css&#039;, array(), PENCI_SOLEDAD_VERSION);

		// Enqueue script
		wp_enqueue_script(&#039;js-cookies&#039;, PENCI_SOLEDAD_URL . &#039;/js/js-cookies.js&#039;, &#039;&#039;, PENCI_SOLEDAD_VERSION, true);
		wp_register_script(&#039;pc-lazy&#039;, PENCI_SOLEDAD_URL . &#039;/js/penci-lazy.js&#039;, &#039;&#039;, PENCI_SOLEDAD_VERSION, true);
		wp_register_script(&#039;penci-contact-form&#039;, PENCI_SOLEDAD_URL . &#039;/js/contact-form.js&#039;, &#039;&#039;, PENCI_SOLEDAD_VERSION, true);

        wp_register_script(&#039;gsap&#039;, PENCI_SOLEDAD_URL . &#039;/js/gsap.min.js&#039;, &#039;&#039;, PENCI_SOLEDAD_VERSION, true);
		wp_register_script(&#039;ff40&#039;, PENCI_SOLEDAD_URL . &#039;/js/ff40.js&#039;, &#039;&#039;, PENCI_SOLEDAD_VERSION, true);
		wp_register_script(&#039;mtp-filters&#039;, PENCI_SOLEDAD_URL . &#039;/js/mtp-filters.js&#039;, &#039;&#039;, PENCI_SOLEDAD_VERSION, true);
		wp_register_script( &#039;jquery.pjax&#039;, PENCI_SOLEDAD_URL . &#039;/js/jquery.pjax.js&#039;, array(), PENCI_SOLEDAD_VERSION, true );

		wp_enqueue_script(&#039;pc-lazy&#039;);

		if (get_theme_mod(&#039;penci_enable_featured_video_bg&#039;) || is_page()) {
			if (is_page()) {
				$metavideo = get_post_meta(get_the_ID(), &#039;penci_page_slider&#039;, true);
			}
			if (get_theme_mod(&#039;penci_enable_featured_video_bg&#039;) || (is_page() &amp;&amp; &#039;video&#039; == $metavideo)) {
				wp_enqueue_script(&#039;penci-video-background&#039;, PENCI_SOLEDAD_URL . &#039;/js/video-background.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
			}
		}

		if (get_theme_mod(&#039;penci_single_font_changer&#039;)) {
			wp_enqueue_script(&#039;jquery.range-min.js&#039;, PENCI_SOLEDAD_URL . &#039;/js/jquery.range-min.js&#039;, array(), PENCI_SOLEDAD_VERSION, true);
		}

		wp_enqueue_script(&#039;penci-libs-js&#039;, PENCI_SOLEDAD_URL . &#039;/js/libs-script.min.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);

		if (get_theme_mod(&#039;penci_enable_smooth_scroll&#039;) ) {
			wp_enqueue_script(&#039;penci-smoothscroll&#039;, PENCI_SOLEDAD_URL . &#039;/js/smoothscroll.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		}
		$minify_js = get_theme_mod(&#039;penci_speed_js_minify&#039;);
		$sub_fix_min = $minify_js ? &#039;.min&#039; : &#039;&#039;;

		if ( get_theme_mod( &#039;penci_header_menu_auto_more&#039; ) ) {
			wp_enqueue_script(&#039;menu-scripts&#039;, PENCI_SOLEDAD_URL . &#039;/js/menu.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		}

		wp_enqueue_script(&#039;main-scripts&#039;, PENCI_SOLEDAD_URL . &#039;/js/main&#039; . $sub_fix_min . &#039;.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);

		if (defined(&#039;ELEMENTOR_VERSION&#039;)) {
			if (\Elementor\Plugin::$instance-&gt;preview-&gt;is_preview_mode()) {
				wp_enqueue_script(&#039;penci-elementor&#039;, PENCI_SOLEDAD_URL . &#039;/js/elementor.js&#039;, array(&#039;main-scripts&#039;), PENCI_SOLEDAD_VERSION, true);
			}
		}

		wp_localize_script(&#039;main-scripts&#039;, &#039;ajax_var_more&#039;, $localize_script);

		wp_enqueue_script(&#039;penci_ajax_like_post&#039;, PENCI_SOLEDAD_URL . &#039;/js/post-like&#039; . $sub_fix_min . &#039;.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_register_script(&#039;penci_ajax_more_posts&#039;, PENCI_SOLEDAD_URL . &#039;/js/more-post&#039; . $sub_fix_min . &#039;.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_ajax_more_posts&#039;,
			&#039;penci_ajax_more_posts&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_more_post_ajax&#039;),
			)
		);
		wp_register_script(&#039;penci_ajax_more_scroll&#039;, PENCI_SOLEDAD_URL . &#039;/js/more-post-scroll&#039; . $sub_fix_min . &#039;.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_ajax_more_scroll&#039;,
			&#039;pajax_mscroll&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_more_post_ajax&#039;),
			)
		);
		wp_register_script(&#039;penci_ajax_archive_more_scroll&#039;, PENCI_SOLEDAD_URL . &#039;/js/archive-more-post&#039; . $sub_fix_min . &#039;.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_ajax_archive_more_scroll&#039;,
			&#039;pcajaxamore_scroll&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;archive-more-post&#039;),
			)
		);
		wp_register_script(&#039;penci_bgajax_more_posts&#039;, PENCI_SOLEDAD_URL . &#039;/js/more-post-bg.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_bgajax_more_posts&#039;,
			&#039;pcbgajax_more_posts&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_ajax_filter_bg&#039;),
			)
		);
		wp_register_script(&#039;penci_bgajax_more_scroll&#039;, PENCI_SOLEDAD_URL . &#039;/js/more-post-scroll-bg.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_bgajax_more_scroll&#039;,
			&#039;pc_bgajax_more_scroll&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_ajax_filter_bg&#039;),
			)
		);
		wp_register_script(&#039;penci_megamenu&#039;, PENCI_SOLEDAD_URL . &#039;/js/megamenus.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_megamenu&#039;,
			&#039;penci_megamenu_var&#039;,
			array(
				&#039;url&#039; 	=&gt; get_theme_mod(&#039;penci_handle_ajax_with_rest_api&#039;) ? esc_url(rest_url(&#039;penci/v1/get_menu_data&#039;)) : esc_url(admin_url(&#039;admin-ajax.php&#039;)),
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_megamenu&#039;),
			)
		);

		if (get_theme_mod(&#039;penci_page_navigation_ajax&#039;) &amp;&amp; !get_theme_mod(&#039;penci_page_navigation_scroll&#039;)) {
			wp_enqueue_script(&#039;penci_ajax_more_posts&#039;);
		}

		if (get_theme_mod(&#039;penci_page_navigation_scroll&#039;)) {
			wp_enqueue_script(&#039;penci_ajax_more_scroll&#039;);
		}


		if (get_theme_mod(&#039;penci_archive_nav_ajax&#039;) || get_theme_mod(&#039;penci_archive_nav_scroll&#039;)) {
			wp_enqueue_script(&#039;penci_ajax_archive_more_scroll&#039;);
		}

		wp_register_script(&#039;penci_bgajax_more_terms&#039;, PENCI_SOLEDAD_URL . &#039;/js/more-terms-bg.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_bgajax_more_terms&#039;,
			&#039;penci_bgajax_more_terms&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_ajax_terms_filter_bg&#039;),
				&#039;url&#039; =&gt; admin_url(&#039;admin-ajax.php&#039;),
			)
		);

		wp_register_script(&#039;penci_bgajax_more_terms_scroll&#039;, PENCI_SOLEDAD_URL . &#039;/js/more-terms-scroll-bg.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_bgajax_more_terms_scroll&#039;,
			&#039;penci_bgajax_more_terms&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_ajax_terms_filter_bg&#039;),
				&#039;url&#039; =&gt; admin_url(&#039;admin-ajax.php&#039;),
			)
		);

		wp_register_script(&#039;penci_ajax_filter_terms_bg&#039;, PENCI_SOLEDAD_URL . &#039;/js/ajax-filter-terms.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_ajax_filter_terms_bg&#039;,
			&#039;penci_ajax_terms_filter_bg&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_ajax_terms_filter_bg&#039;),
				&#039;url&#039; =&gt; admin_url(&#039;admin-ajax.php&#039;),
			)
		);

		// js for comments
		if (is_singular() &amp;&amp; get_option(&#039;thread_comments&#039;)) {
			wp_enqueue_script(&#039;comment-reply&#039;);
		}

		// register
		wp_register_script(&#039;penci_ajax_filter_bg&#039;, PENCI_SOLEDAD_URL . &#039;/js/ajax-filter-bg.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_ajax_filter_bg&#039;,
			&#039;pcfilterbg_ajax&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_ajax_filter_bg&#039;),
			)
		);
		wp_register_script(&#039;penci_ajax_filter_slist&#039;, PENCI_SOLEDAD_URL . &#039;/js/ajax-filter-slist.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_ajax_filter_slist&#039;,
			&#039;pcslist_ajax&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_ajax_filter_slist&#039;),
			)
		);
		wp_register_script(&#039;penci_ajax_filter_fcat&#039;, PENCI_SOLEDAD_URL . &#039;/js/ajax-filter-fcat.js&#039;, array(), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_ajax_filter_fcat&#039;,
			&#039;pcfcat_ajax&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_ajax_filter_fcat&#039;),
			)
		);
		wp_register_script(&#039;penci_ajax_filter_latest&#039;, PENCI_SOLEDAD_URL . &#039;/js/ajax-filter-latest.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_ajax_filter_latest&#039;,
			&#039;pclatest_ajax&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_more_post_ajax&#039;),
			)
		);
		wp_register_script(&#039;penci_slajax_more_posts&#039;, PENCI_SOLEDAD_URL . &#039;/js/ajax-more-slist.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_slajax_more_posts&#039;,
			&#039;penci_slajax&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_ajax_filter_slist&#039;),
			)
		);
		wp_register_script(&#039;penci_slajax_more_scroll&#039;, PENCI_SOLEDAD_URL . &#039;/js/ajax-more-scroll-slist.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_slajax_more_scroll&#039;,
			&#039;penci_smlajax&#039;,
			array(
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_ajax_filter_slist&#039;),
			)
		);
		wp_register_script(&#039;penci_widget_tabs&#039;, PENCI_SOLEDAD_URL . &#039;/js/widget-tabs.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_register_script(&#039;penci_widgets_ajax&#039;, PENCI_SOLEDAD_URL . &#039;/js/widgets-ajax.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(
			&#039;penci_widgets_ajax&#039;,
			&#039;penci_widgets_ajax&#039;,
			array(
				&#039;url&#039; =&gt; admin_url(&#039;admin-ajax.php&#039;),
				&#039;nonce&#039; =&gt; wp_create_nonce(&#039;penci_widgets_ajax&#039;),
			)
		);
		wp_register_script(&#039;penci_tiktok_embed&#039;, &#039;https://www.tiktok.com/embed.js&#039;, &#039;&#039;, PENCI_SOLEDAD_VERSION);
		wp_register_script(&#039;penci_web_stories&#039;, PENCI_SOLEDAD_URL . &#039;/js/web-stories.js&#039;, &#039;&#039;, PENCI_SOLEDAD_VERSION);

		wp_register_script(&#039;penci-animate-headline&#039;, PENCI_SOLEDAD_URL . &#039;/js/heading-animates.js&#039;, array(&#039;jquery&#039;, &#039;elementor-frontend-modules&#039;), PENCI_SOLEDAD_VERSION);
		wp_register_script(&#039;penci-float-banner&#039;, PENCI_SOLEDAD_URL . &#039;/js/float-banner.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);

		wp_register_style(&#039;jquery.toast&#039;, PENCI_SOLEDAD_URL . &#039;/css/jquery.toast.min.css&#039;, array(), PENCI_SOLEDAD_VERSION);
		wp_register_script(&#039;jquery.toast&#039;, PENCI_SOLEDAD_URL . &#039;/js/jquery.toast.min.js&#039;, array(), PENCI_SOLEDAD_VERSION, true);
		wp_register_script(&#039;jquery.inview&#039;, PENCI_SOLEDAD_URL . &#039;/js/inview.js&#039;, array(), PENCI_SOLEDAD_VERSION, true);


		if (get_theme_mod(&#039;penci_enable_reading_bar&#039;)) {
			wp_enqueue_script(&#039;penci-header-scroll&#039;, PENCI_SOLEDAD_URL . &#039;/js/header-scroll.js&#039;, array(&#039;jquery&#039;,&#039;jquery.inview&#039;), PENCI_SOLEDAD_VERSION, true);
		}

		wp_enqueue_script(&#039;penci-sticky-share&#039;, PENCI_SOLEDAD_URL . &#039;/js/sticky_share.js&#039;, array(&#039;jquery&#039;,&#039;jquery.inview&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_register_script(&#039;penci-marquee&#039;, PENCI_SOLEDAD_URL . &#039;/js/penci-marquee.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_register_script(&#039;penci-abc-scroll&#039;, PENCI_SOLEDAD_URL . &#039;/js/abc-scroll.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);

        if ( defined(&#039;MC4WP_VERSION&#039; ) &amp;&amp; get_theme_mod( &#039;penci_mc4wp_ajax&#039;, true ) ) {
            wp_enqueue_script(&#039;penci-mc4wp&#039;, PENCI_SOLEDAD_URL . &#039;/js/mc4wp-form.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
        }

		if (get_theme_mod(&#039;penci_textshare_enable&#039;)){
			$share_services = explode(&#039;,&#039;,get_theme_mod(&#039;penci_textshare_services&#039;,&#039;facebook,twitter&#039;));
        	wp_enqueue_script(&#039;penci-selection-sharer&#039;, PENCI_SOLEDAD_URL . &#039;/js/selection-sharer.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
        	wp_localize_script(
				&#039;penci-selection-sharer&#039;,
				&#039;penci_selection_sharer&#039;,
				array(
					&#039;bgcolor&#039; =&gt; get_theme_mod(&#039;penci_textshare_bgcolor&#039;,&#039;#ffffff&#039;) ? get_theme_mod(&#039;penci_textshare_bgcolor&#039;,&#039;#ffffff&#039;) : &#039;#ffffff&#039;,
					&#039;txtcolor&#039; =&gt; get_theme_mod(&#039;penci_textshare_txtcolor&#039;,&#039;#333333&#039;) ? get_theme_mod(&#039;penci_textshare_txtcolor&#039;,&#039;#333333&#039;) : &#039;#333333&#039;,
					&#039;facebook&#039; =&gt; (bool) in_array(&#039;facebook&#039;,$share_services),
					&#039;facebookid&#039; =&gt; get_theme_mod(&#039;penci_fbappid&#039;),
					&#039;twitter&#039; =&gt; (bool) in_array(&#039;twitter&#039;,$share_services),
					&#039;linkedin&#039; =&gt; (bool) in_array(&#039;likedin&#039;,$share_services),
					&#039;whatsapp&#039; =&gt; (bool) in_array(&#039;whatsapp&#039;,$share_services),
					&#039;telegram&#039; =&gt; (bool) in_array(&#039;telegram&#039;,$share_services),
					&#039;copy&#039; =&gt; (bool) in_array(&#039;copy&#039;,$share_services),
				)
			);
    	}
		
		if ( get_theme_mod( &#039;penci_cursor_enable&#039; ) ) {
			wp_enqueue_script(&#039;penci-cursor-effect&#039;, PENCI_SOLEDAD_URL . &#039;/js/cursor.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		}

		if ( get_theme_mod( &#039;penci_enable_content_protection&#039; ) ) {
			wp_enqueue_script(&#039;penci-content-protector&#039;, PENCI_SOLEDAD_URL . &#039;/js/content-protector.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		}

		if ( get_theme_mod( &#039;penci_archive_enable_animation&#039; ) ) {
			wp_enqueue_style(&#039;penci-archive-animation&#039;, PENCI_SOLEDAD_URL . &#039;/css/animate.css&#039;, array(), PENCI_SOLEDAD_VERSION);
			wp_enqueue_script(&#039;penci-archive-animation&#039;, PENCI_SOLEDAD_URL . &#039;/js/archive-animation.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		}

		wp_register_script(&#039;penci-nav-scroll&#039;, PENCI_SOLEDAD_URL . &#039;/js/nav-scroll.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);

		wp_register_style( &#039;penci-timeline&#039;, PENCI_SOLEDAD_URL . &#039;/inc/elementor/assets/css/timeline.css&#039;, array(), PENCI_SOLEDAD_VERSION );
		wp_register_script( &#039;penci-marquee-widget&#039;, PENCI_SOLEDAD_URL . &#039;/js/jquery.marquee.min.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true );

		if ( &#039;sticky-left&#039; == get_theme_mod( &#039;penci_single_poslcscount&#039; ) &amp;&amp; is_single() ) {
			wp_enqueue_script(&#039;penci-sticky-share-v2&#039;, PENCI_SOLEDAD_URL . &#039;/js/sticky_share_v2.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		}

		
		
	}
}

add_action( &#039;customize_controls_enqueue_scripts&#039;, function() {
	wp_enqueue_script(&#039;customizer-helper-2&#039;, PENCI_SOLEDAD_URL . &#039;/js/customizer-helper.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
});

add_action( &#039;customize_preview_init&#039;, function() {
	wp_enqueue_script(&#039;customizer-helper-preview&#039;, PENCI_SOLEDAD_URL . &#039;/js/customizer-preview.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
	wp_localize_script(
				&#039;customizer-helper-preview&#039;,
				&#039;PenciPreview&#039;,
				array(
					&#039;widgetURL&#039; =&gt; admin_url(&#039;widgets.php&#039;),
				)
			);
});

add_action(&#039;wp_enqueue_scripts&#039;,function(){
	if (get_theme_mod(&#039;penci_archive_ajax_navigation&#039;) ) {
		wp_enqueue_script(&#039;penci_archive_ajax_navigation&#039;,PENCI_SOLEDAD_URL . &#039;/js/archive_ajax_navigation.js&#039;, array(&#039;jquery&#039;,&#039;jquery.pjax&#039;), PENCI_SOLEDAD_VERSION, true);
		wp_localize_script(&#039;penci_archive_ajax_navigation&#039;, &#039;PCAJXNAV&#039;, penci_soledad_archive_pag_attr());
	}
}, 999 );


/**
 * Enqueue styles/scripts
 * Hook to action wp_enqueue_scripts
 *
 * @return void
 *@since 2.0
 */
if (!function_exists(&#039;penci_load_admin_scripts&#039;)) {
	add_action(&#039;admin_enqueue_scripts&#039;, &#039;penci_load_admin_scripts&#039;, 0 );
	function penci_load_admin_scripts($hook) {
		$screen = function_exists( &#039;get_current_screen&#039; ) ? get_current_screen() : null;

		wp_enqueue_style(&#039;admin-css&#039;, PENCI_SOLEDAD_URL . &#039;/css/admin.css&#039;, array(), PENCI_SOLEDAD_VERSION);

		if ( penci_soledad_admin_needs_media_controls( $hook, $screen ) ) {
			wp_enqueue_media();
			wp_enqueue_script(&#039;opts-field-upload-js&#039;, PENCI_SOLEDAD_URL . &#039;/js/field_upload.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		}

		if ( penci_soledad_admin_needs_color_picker( $hook, $screen ) ) {
			wp_enqueue_style(&#039;wp-color-picker&#039;);
			wp_enqueue_script(&#039;penci-opts-color-js&#039;, PENCI_SOLEDAD_URL . &#039;/js/field_color.js&#039;, array(&#039;jquery&#039;, &#039;wp-color-picker&#039;), PENCI_SOLEDAD_VERSION, true);
		}

		if ( penci_soledad_admin_needs_reorder( $hook, $screen ) ) {
			wp_enqueue_script(&#039;jquery-ui-sortable&#039;, array(&#039;jquery&#039;));
			wp_enqueue_script(&#039;reorder-slides&#039;, PENCI_SOLEDAD_URL . &#039;/js/reorder.js&#039;, array(&#039;jquery&#039;, &#039;jquery-ui-sortable&#039;), PENCI_SOLEDAD_VERSION, true);
		}

		if ($hook == &#039;widgets.php&#039; || &#039;nav-menus.php&#039; == $hook) {
			wp_enqueue_script(&#039;penci-admin-widget&#039;, PENCI_SOLEDAD_URL . &#039;/js/admin-widget.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);

			wp_localize_script(
				&#039;penci-admin-widget&#039;,
				&#039;Penci&#039;,
				array(
					&#039;ajaxUrl&#039; =&gt; admin_url(&#039;admin-ajax.php&#039;),
					&#039;nonce&#039; =&gt; wp_create_nonce(&#039;ajax-nonce&#039;),
					&#039;sidebarAddFails&#039; =&gt; esc_html__(&#039;Adding custom sidebar fails.&#039;, &#039;soledad&#039;),
					&#039;sidebarRemoveFails&#039; =&gt; esc_html__(&#039;Removing custom sidebar fails.&#039;, &#039;soledad&#039;),
					&#039;cfRemovesidebar&#039; =&gt; esc_html__(&#039;Are you sure you want to remove this custom sidebar?&#039;, &#039;soledad&#039;),
				)
			);
		}

		if (function_exists(&#039;getpaid&#039;)) {
			wp_enqueue_script(&#039;penci-admin-getpaid&#039;, PENCI_SOLEDAD_URL . &#039;/js/getpaid.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
		}

        if ($hook == &#039;post.php&#039; || $hook == &#039;post-new.php&#039; ) {
            wp_enqueue_script(&#039;penci-admin-post&#039;, PENCI_SOLEDAD_URL . &#039;/js/admin-post.js&#039;, array(&#039;jquery&#039;), PENCI_SOLEDAD_VERSION, true);
        }

		if ( penci_soledad_admin_is_editor_screen( $hook, $screen ) ) {
			wp_enqueue_style( &#039;wp-edit-blocks&#039; );
		}

		$wp_version = $GLOBALS[&#039;wp_version&#039;];
		if ( penci_soledad_admin_is_editor_screen( $hook, $screen ) &amp;&amp; version_compare($wp_version, &#039;7.0-beta&#039;, &#039;&gt;&#039;)) {
			wp_enqueue_style(&#039;penci-admin-7&#039;, PENCI_SOLEDAD_URL . &#039;/css/customizer7.css&#039;, array(), PENCI_SOLEDAD_VERSION);
		}
	}
}

if ( ! function_exists( &#039;penci_soledad_admin_is_editor_screen&#039; ) ) {
	function penci_soledad_admin_is_editor_screen( $hook, $screen = null ) {
		if ( in_array( $hook, array( &#039;post.php&#039;, &#039;post-new.php&#039; ), true ) ) {
			return true;
		}

		return $screen &amp;&amp; in_array( $screen-&gt;base, array( &#039;post&#039;, &#039;site-editor&#039; ), true );
	}
}

if ( ! function_exists( &#039;penci_soledad_admin_is_theme_screen&#039; ) ) {
	function penci_soledad_admin_is_theme_screen( $hook, $screen = null ) {
		$page = isset( $_GET[&#039;page&#039;] ) ? sanitize_key( wp_unslash( $_GET[&#039;page&#039;] ) ) : &#039;&#039;;

		if ( $page &amp;&amp; ( 0 === strpos( $page, &#039;soledad_&#039; ) || 0 === strpos( $page, &#039;penci_&#039; ) || &#039;tgmpa-install-plugins&#039; === $page ) ) {
			return true;
		}

		if ( is_string( $hook ) &amp;&amp; ( false !== strpos( $hook, &#039;soledad&#039; ) || false !== strpos( $hook, &#039;penci&#039; ) ) ) {
			return true;
		}

		return $screen &amp;&amp; isset( $screen-&gt;id ) &amp;&amp; ( false !== strpos( $screen-&gt;id, &#039;soledad&#039; ) || false !== strpos( $screen-&gt;id, &#039;penci&#039; ) );
	}
}

if ( ! function_exists( &#039;penci_soledad_admin_needs_media_controls&#039; ) ) {
	function penci_soledad_admin_needs_media_controls( $hook, $screen = null ) {
		if ( penci_soledad_admin_is_theme_screen( $hook, $screen ) || penci_soledad_admin_is_editor_screen( $hook, $screen ) ) {
			return true;
		}

		if ( in_array( $hook, array( &#039;term.php&#039;, &#039;edit-tags.php&#039;, &#039;profile.php&#039;, &#039;user-edit.php&#039;, &#039;widgets.php&#039;, &#039;nav-menus.php&#039; ), true ) ) {
			return true;
		}

		if ( $screen &amp;&amp; isset( $screen-&gt;post_type ) &amp;&amp; in_array( $screen-&gt;post_type, array( &#039;penci_slider&#039;, &#039;penci_cfonts&#039; ), true ) ) {
			return true;
		}

		return false;
	}
}

if ( ! function_exists( &#039;penci_soledad_admin_needs_color_picker&#039; ) ) {
	function penci_soledad_admin_needs_color_picker( $hook, $screen = null ) {
		if ( penci_soledad_admin_is_theme_screen( $hook, $screen ) || penci_soledad_admin_is_editor_screen( $hook, $screen ) ) {
			return true;
		}

		return in_array( $hook, array( &#039;term.php&#039;, &#039;edit-tags.php&#039;, &#039;widgets.php&#039; ), true );
	}
}

if ( ! function_exists( &#039;penci_soledad_admin_needs_reorder&#039; ) ) {
	function penci_soledad_admin_needs_reorder( $hook, $screen = null ) {
		if ( penci_soledad_admin_is_theme_screen( $hook, $screen ) || in_array( $hook, array( &#039;term.php&#039;, &#039;edit-tags.php&#039; ), true ) ) {
			return true;
		}

		return $screen &amp;&amp; isset( $screen-&gt;post_type ) &amp;&amp; &#039;penci_slider&#039; === $screen-&gt;post_type;
	}
}

if ( ! function_exists( &#039;penci_soledad_enqueue_editor_fonts&#039; ) ) {
	function penci_soledad_enqueue_editor_fonts() {
		if ( ! get_theme_mod( &#039;penci_disable_default_fonts&#039; ) ) {
			$media_fonts = &#039;&#039;;

			if ( function_exists( &#039;penci_mobile_fonts_url&#039; ) &amp;&amp; penci_mobile_fonts_url() ) {
				$media_fonts = &#039;only screen and (min-width: 768px)&#039;;
				wp_enqueue_style( &#039;penci-mobile-fonts&#039;, penci_mobile_fonts_url(), array(), PENCI_SOLEDAD_VERSION, &#039;only screen and (max-width: 768px)&#039; );
			}

			if ( function_exists( &#039;penci_fonts_url&#039; ) &amp;&amp; penci_fonts_url() ) {
				wp_enqueue_style( &#039;penci-fonts&#039;, penci_fonts_url(), array(), PENCI_SOLEDAD_VERSION, $media_fonts );
			}
		}
	}
}

if ( ! function_exists( &#039;penci_soledad_block_editor_content_fonts&#039; ) ) {
	add_action( &#039;enqueue_block_assets&#039;, &#039;penci_soledad_block_editor_content_fonts&#039; );
	function penci_soledad_block_editor_content_fonts() {
		if ( ! is_admin() ) {
			return;
		}

		$screen = function_exists( &#039;get_current_screen&#039; ) ? get_current_screen() : null;
		if ( ! $screen || ! method_exists( $screen, &#039;is_block_editor&#039; ) || ! $screen-&gt;is_block_editor() ) {
			return;
		}

		penci_soledad_enqueue_editor_fonts();
	}
}

if ( ! function_exists( &#039;penci_soledad_block_editor_customizer_styles&#039; ) ) {
	add_action( &#039;enqueue_block_editor_assets&#039;, &#039;penci_soledad_block_editor_customizer_styles&#039; );
	function penci_soledad_block_editor_customizer_styles() {
		penci_soledad_enqueue_editor_fonts();

		wp_register_style( &#039;penci-block-editor-customizer&#039;, false, array(), PENCI_SOLEDAD_VERSION );
		wp_enqueue_style( &#039;penci-block-editor-customizer&#039; );

		$customizer_css = penci_soledad_get_block_editor_customizer_css();
		if ( $customizer_css ) {
			wp_add_inline_style( &#039;penci-block-editor-customizer&#039;, $customizer_css );
		}
	}
}

if ( ! function_exists( &#039;penci_soledad_block_editor_settings_styles&#039; ) ) {
	add_filter( &#039;block_editor_settings_all&#039;, &#039;penci_soledad_block_editor_settings_styles&#039; );
	function penci_soledad_block_editor_settings_styles( $settings ) {
		$customizer_css = penci_soledad_get_block_editor_customizer_css();
		if ( ! $customizer_css ) {
			return $settings;
		}

		if ( ! isset( $settings[&#039;styles&#039;] ) || ! is_array( $settings[&#039;styles&#039;] ) ) {
			$settings[&#039;styles&#039;] = array();
		}

		$settings[&#039;styles&#039;][] = array(
			&#039;css&#039; =&gt; $customizer_css,
		);

		return $settings;
	}
}

if ( ! function_exists( &#039;penci_soledad_get_block_editor_customizer_css&#039; ) ) {
	function penci_soledad_get_block_editor_customizer_css() {
		$settings = array(
			&#039;penci_color_accent&#039;           =&gt; get_theme_mod( &#039;penci_color_accent&#039; ),
			&#039;penci_general_text_color&#039;     =&gt; get_theme_mod( &#039;penci_general_text_color&#039; ),
			&#039;penci_heading_color&#039;          =&gt; get_theme_mod( &#039;penci_heading_color&#039; ),
			&#039;penci_font_for_body&#039;          =&gt; get_theme_mod( &#039;penci_font_for_body&#039; ),
			&#039;penci_font_for_title&#039;         =&gt; get_theme_mod( &#039;penci_font_for_title&#039; ),
			&#039;penci_font_weight_bodytext&#039;   =&gt; get_theme_mod( &#039;penci_font_weight_bodytext&#039; ),
			&#039;penci_font_weight_title&#039;      =&gt; get_theme_mod( &#039;penci_font_weight_title&#039; ),
			&#039;penci_font_for_size_body&#039;     =&gt; get_theme_mod( &#039;penci_font_for_size_body&#039; ),
			&#039;penci_font_mfor_size_body&#039;    =&gt; get_theme_mod( &#039;penci_font_mfor_size_body&#039; ),
			&#039;penci_body_line_height&#039;       =&gt; get_theme_mod( &#039;penci_body_line_height&#039; ),
		);
		$cache_key = &#039;penci_editor_css_&#039; . md5( wp_json_encode( $settings ) . PENCI_SOLEDAD_VERSION );
		$css       = get_transient( $cache_key );

		if ( false !== $css ) {
			return $css;
		}

		$body_font    = penci_soledad_editor_font_stack( $settings[&#039;penci_font_for_body&#039;], &quot;&#039;PT Serif&#039;, serif&quot; );
		$heading_font = penci_soledad_editor_font_stack( $settings[&#039;penci_font_for_title&#039;], &quot;&#039;Raleway&#039;, sans-serif&quot; );
		$text_color   = penci_soledad_editor_css_value( $settings[&#039;penci_general_text_color&#039;], &#039;#313131&#039; );
		$heading_cl   = penci_soledad_editor_css_value( $settings[&#039;penci_heading_color&#039;], &#039;#313131&#039; );
		$accent_cl    = penci_soledad_editor_css_value( $settings[&#039;penci_color_accent&#039;], &#039;#6eb48c&#039; );
		$heading_w    = penci_soledad_editor_css_value( $settings[&#039;penci_font_weight_title&#039;], &#039;bold&#039; );
		$body_w       = penci_soledad_editor_css_value( $settings[&#039;penci_font_weight_bodytext&#039;], &#039;&#039; );
		$body_size    = is_numeric( $settings[&#039;penci_font_for_size_body&#039;] ) &amp;&amp; 1 &lt; (int) $settings[&#039;penci_font_for_size_body&#039;] ? (int) $settings[&#039;penci_font_for_size_body&#039;] : 0;
		$mobile_size  = is_numeric( $settings[&#039;penci_font_mfor_size_body&#039;] ) &amp;&amp; 1 &lt; (int) $settings[&#039;penci_font_mfor_size_body&#039;] ? (int) $settings[&#039;penci_font_mfor_size_body&#039;] : 0;
		$line_height  = penci_soledad_editor_css_value( $settings[&#039;penci_body_line_height&#039;], &#039;1.8&#039; );

		$css = &#039;.editor-styles-wrapper{--pcbg-cl:#fff;--pctext-cl:&#039; . $text_color . &#039;;--pcborder-cl:#dedede;--pcheading-cl:&#039; . $heading_cl . &#039;;--pcmeta-cl:#888;--pcaccent-cl:&#039; . $accent_cl . &#039;;--pcbody-font:&#039; . $body_font . &#039;;--pchead-font:&#039; . $heading_font . &#039;;--pchead-wei:&#039; . $heading_w . &#039;;font-family:var(--pcbody-font);color:var(--pctext-cl);}&#039;;
		$css .= &#039;.editor-styles-wrapper :where(p,li,table,blockquote){font-family:var(--pcbody-font);line-height:&#039; . $line_height . &#039;;}&#039;;
		$css .= &#039;.editor-styles-wrapper :where(h1,h2,h3,h4,h5,h6),.editor-post-title .editor-post-title__input{font-family:var(--pchead-font);font-weight:var(--pchead-wei);color:var(--pcheading-cl);}&#039;;
		$css .= &#039;.editor-styles-wrapper a,.editor-styles-wrapper blockquote:before,.editor-styles-wrapper blockquote cite,.editor-styles-wrapper blockquote .author{color:var(--pcaccent-cl);}&#039;;
		$css .= &#039;.editor-styles-wrapper blockquote .author span:after{background:var(--pcaccent-cl);}&#039;;

		if ( $body_w ) {
			$css .= &#039;.editor-styles-wrapper{font-weight:&#039; . $body_w . &#039;;}&#039;;
		}

		if ( $body_size ) {
			$css .= &#039;.editor-styles-wrapper,.editor-styles-wrapper .widget ul li a,.editor-styles-wrapper .widget ul li,.editor-styles-wrapper .widget ol li,.editor-styles-wrapper .post-entry,.editor-styles-wrapper p,.editor-styles-wrapper .post-entry p{font-size:&#039; . absint( $body_size ) . &#039;px;}&#039;;
		}

		if ( $mobile_size ) {
			$css .= &#039;@media only screen and (max-width:480px){.editor-styles-wrapper,.editor-styles-wrapper .widget ul li a,.editor-styles-wrapper .widget ul li,.editor-styles-wrapper .widget ol li,.editor-styles-wrapper .post-entry,.editor-styles-wrapper p,.editor-styles-wrapper .post-entry p{font-size:&#039; . absint( $mobile_size ) . &#039;px;}}&#039;;
		}

		$css = trim( preg_replace( &#039;/\s+/&#039;, &#039; &#039;, $css ) );
		set_transient( $cache_key, $css, DAY_IN_SECONDS );

		return $css;
	}
}

if ( ! function_exists( &#039;penci_soledad_editor_css_value&#039; ) ) {
	function penci_soledad_editor_css_value( $value, $default = &#039;&#039; ) {
		$value = is_scalar( $value ) ? trim( (string) $value ) : &#039;&#039;;

		if ( &#039;&#039; === $value ) {
			return $default;
		}

		return preg_replace( &#039;/[^#%,.0-9a-zA-Z\-\s()]/&#039;, &#039;&#039;, $value );
	}
}

if ( ! function_exists( &#039;penci_soledad_editor_font_stack&#039; ) ) {
	function penci_soledad_editor_font_stack( $font, $default ) {
		if ( ! $font ) {
			return $default;
		}

		$serif_fonts = array( &#039;PT Serif&#039;, &#039;Georgia&#039;, &#039;Times New Roman&#039; );
		$font        = str_replace( &#039;&quot;&#039;, &#039;&#039;, sanitize_text_field( $font ) );
		$font_parts  = explode( &#039;, &#039;, $font );
		$family      = isset( $font_parts[0] ) ? str_replace( &#039;+&#039;, &#039; &#039;, $font_parts[0] ) : &#039;&#039;;
		$fallback    = isset( $font_parts[2] ) &amp;&amp; $font_parts[2] ? $font_parts[2] : &#039;&#039;;

		if ( ! $family ) {
			return $default;
		}

		if ( ! in_array( $fallback, array( &#039;serif&#039;, &#039;sans-serif&#039;, &#039;monospace&#039;, &#039;cursive&#039;, &#039;fantasy&#039;, &#039;system-ui&#039; ), true ) ) {
			$fallback = in_array( $family, $serif_fonts, true ) ? &#039;serif&#039; : &#039;sans-serif&#039;;
		}

		return &quot;&#039;&quot; . $family . &quot;&#039;, &quot; . $fallback;
	}
}

/* Define item posts per page for each big grid style */
if (!function_exists(&#039;penci_big_grid_count_item&#039;)) {
	function penci_big_grid_count_item($biggid_style) {
		$count = 5;
		if (in_array($biggid_style, array(&#039;style-3&#039;, &#039;style-5&#039;, &#039;style-13&#039;, &#039;style-17&#039;))) {
			$count = 3;
		} elseif (in_array($biggid_style, array(&#039;style-7&#039;, &#039;style-8&#039;, &#039;style-11&#039;, &#039;style-12&#039;, &#039;style-14&#039;, &#039;style-16&#039;, &#039;style-18&#039;))) {
			$count = 4;
		} elseif (in_array($biggid_style, array(&#039;style-15&#039;))) {
			$count = 6;
		} elseif (in_array($biggid_style, array(&#039;style-19&#039;, &#039;style-20&#039;, &#039;style-21&#039;, &#039;style-22&#039;))) {
			$count = 7;
		}

		return $count;
	}
}

/* Define big grid current item is big items or not */
if (!function_exists(&#039;penci_big_grid_is_big_items&#039;)) {
	function penci_big_grid_is_big_items($biggid_style) {
		$return = array();

		if (in_array($biggid_style, array(&#039;style-3&#039;, &#039;style-4&#039;, &#039;style-5&#039;, &#039;style-6&#039;, &#039;style-8&#039;, &#039;style-12&#039;, &#039;style-13&#039;, &#039;style-14&#039;, &#039;style-15&#039;, &#039;style-17&#039;))) {
			$return = array(1);
		} elseif (in_array($biggid_style, array(&#039;style-7&#039;, &#039;style-9&#039;))) {
			$return = array(1, 2);
		} elseif (in_array($biggid_style, array(&#039;style-10&#039;, &#039;style-11&#039;))) {
			$return = array(4, 0);
		} elseif (in_array($biggid_style, array(&#039;style-16&#039;, &#039;style-18&#039;))) {
			$return = array(1, 0);
		} elseif (in_array($biggid_style, array(&#039;style-19&#039;))) {
			$return = array(3, 0);
		} elseif (in_array($biggid_style, array(&#039;style-20&#039;))) {
			$return = array(1, 6);
		} elseif (in_array($biggid_style, array(&#039;style-21&#039;))) {
			$return = array(1, 2, 3);
		} elseif (in_array($biggid_style, array(&#039;style-22&#039;))) {
			$return = array(5, 6, 0);
		}

		return $return;
	}
}

/* Get item counter for big grid */
if (!function_exists(&#039;penci_big_grid_count_classes&#039;)) {
	function penci_big_grid_count_classes($bg, $biggid_style, $surplus = false) {
		$classes = $num = &#039;&#039;;

		if (!in_array($biggid_style, array(&#039;style-1&#039;, &#039;style-2&#039;))) {
			$num = penci_big_grid_count_item($biggid_style);
		}

		if ($num) {
			$sur_plus = $bg % $num;
			$classes = &#039; bgitem-&#039; . $sur_plus;
			if ($surplus == true) {
				$classes = $sur_plus;
			}
		}

		return $classes;
	}
}

/**
 * Fallback when menu location is not checked
 * Callback function in wp_nav_menu() on header.php
 *
 * @since 1.0
 */
if (!function_exists(&#039;penci_menu_fallback&#039;)) {
	function penci_menu_fallback() {
		if (!current_user_can(&#039;manage_options&#039;)) {
			echo &#039;&lt;ul class=&quot;menu penci-topbar-menu&quot;&gt;&lt;li class=&quot;menu-item-first&quot;&gt;&lt;a href=&quot;&#039; . esc_url(home_url(&#039;/&#039;)) . &#039;&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&#039;;
		} else {
			echo &#039;&lt;ul class=&quot;menu penci-topbar-menu&quot;&gt;&lt;li class=&quot;menu-item-first&quot;&gt;&lt;a href=&quot;&#039; . esc_url(home_url(&#039;/&#039;)) . &#039;wp-admin/nav-menus.php?action=locations&quot;&gt;Create or select a menu&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&#039;;
		}
	}
}

/**
 * Add more penci-body-boxed to body_class() function
 * This class will add more when body boxed is enable
 *
 * @package WordPress
 * @since 1.0
 */

if (!function_exists(&#039;penci_add_more_body_boxed_class&#039;)) {
	add_filter(&#039;body_class&#039;, &#039;penci_add_more_body_boxed_class&#039;);
	function penci_add_more_body_boxed_class($classes) {

		$classes[] = &#039;penci-no-js&#039;;

		if ( get_theme_mod( &#039;penci_header_menu_auto_more&#039; ) ) {
			$classes[] = &#039;penci-hmenu-auto-more&#039;;
		}

        if ( get_theme_mod( &#039;penci_archive_disable_desc_collapse&#039;, true ) ) {
            $classes[] = &#039;penci-disable-desc-collapse&#039;;
        }

		if (get_theme_mod(&#039;penci_body_boxed_layout&#039;) &amp;&amp; !get_theme_mod(&#039;penci_vertical_nav_show&#039;)) {
			// add &#039;penci-body-boxed&#039; to the $classes array
			$classes[] = &#039;penci-body-boxed&#039;;
		}

		if (defined(&#039;PENCI_SOLEDAD_VERSION&#039;)) {
			$version = PENCI_SOLEDAD_VERSION;
			$version_render = &#039;soledad-ver-&#039; . str_replace(&#039;.&#039;, &#039;-&#039;, $version);
			$classes[] = $version_render;
		}

		if (get_theme_mod(&#039;penci_vertical_nav_show&#039;)) {
			$classes[] = &#039;penci-vernav-enable&#039;;
			$class_post = &#039;penci-vernav-poleft&#039;;
			if (get_theme_mod(&#039;penci_menu_hbg_pos&#039;) == &#039;right&#039;) {
				$class_post = &#039;penci-vernav-poright&#039;;
			}
			$classes[] = $class_post;
		}

		if (get_theme_mod(&#039;penci_vernav_click_parent&#039;)) {
			$classes[] = &#039;penci-vernav-cparent&#039;;
		}

		if (get_theme_mod(&#039;penci_menu_hbg_click_parent&#039;)) {
			$classes[] = &#039;penci-hbg-cparent&#039;;
		}

		if (get_theme_mod(&#039;penci_enable_dark_layout&#039;)) {
			$classes[] = &#039;pcdark-df&#039;;
		}

		if (get_theme_mod(&#039;penci_enable_dark_layout&#039;)) {
			$classes[] = &#039;pcdark-mode&#039;;
		} else {
			$classes[] = &#039;pclight-mode&#039;;
		}

		if (get_theme_mod(&#039;penci_catdesign&#039;)) {
			$pccat_design = get_theme_mod(&#039;penci_catdesign&#039;);
			if ($pccat_design) {
				$classes[] = &#039;pccatds-filled&#039;;
				$classes[] = &#039;pccatdss-&#039; . $pccat_design;
			}
		}

		if (is_singular() &amp;&amp; !is_page()) {
			$single_style = penci_get_single_style();

			if ( ! in_array($single_style, array(&#039;style-1&#039;, &#039;style-2&#039;))) {
				$classes[] = &#039;penci-body-single-&#039; . $single_style;
			}

			if (get_theme_mod(&#039;penci_move_title_bellow&#039;)) {
				$classes[] = &#039;penci-body-title-bellow&#039;;
			}

			$post_format = get_post_format();
			if (!has_post_thumbnail() || (get_theme_mod(&#039;penci_post_thumb&#039;) &amp;&amp; !in_array($post_format, array(&#039;link&#039;, &#039;quote&#039;, &#039;gallery&#039;, &#039;video&#039;, &#039;audio&#039;)))) {
				$classes[] = &#039;penci-hide-pthumb&#039;;
			} else {
				$classes[] = &#039;penci-show-pthumb&#039;;
			}
		}

		$classes[] = &#039;pcmn-drdw-style-&#039; . get_theme_mod(&#039;penci_header_menu_ani_style&#039;, &#039;slide_down&#039;);

		$header_builder = function_exists(&#039;penci_check_theme_mod&#039;) &amp;&amp; penci_check_theme_mod() ? penci_check_theme_mod() : &#039;&#039;;
		$header_search_style = !empty($header_builder) ? penci_get_builder_mod(&#039;penci_header_search_style&#039;, &#039;showup&#039;) : get_theme_mod(&#039;penci_topbar_search_style&#039;, &#039;default&#039;);
		$classes[] = &#039;pchds-&#039; . esc_attr($header_search_style);

		if ( get_theme_mod( &#039;penci_lazyloaded_effect&#039; ) ) {
			$classes[] = &#039;pclz-effs pclz-&#039; . get_theme_mod( &#039;penci_lazyloaded_effect&#039; );
		}

		if ( get_theme_mod( &#039;penci_toc_asticky&#039; ) &amp;&amp; is_singular() ) {
			$classes[] = &#039;penci-aw-sticky&#039;;
		}
		
		if ( get_theme_mod( &#039;penci_cursor_enable&#039; ) ) {
			$classes[] = &#039;penci-cc-cursor&#039;;
		}

		if ( get_theme_mod( &#039;penci_thumbnail_zoom_effect&#039; ) ) {
			$classes[] = &#039;pczoomt-effect&#039;;
		}

		if ( get_theme_mod( &#039;penci_header_show_submenu_overlay&#039; ) ) {
			$classes[] = &#039;penci-hsubmenu-overlay&#039;;
		}

		if ( get_theme_mod( &#039;penci_archive_hover_underline&#039; ) ) {
			$classes[] = &#039;pah-underline&#039;;
		}
		
		if ( get_theme_mod( &#039;penci_single_poslcscount&#039; ) &amp;&amp; is_single() ) {
			$classes[] = &#039;pcsshare-&#039; . get_theme_mod( &#039;penci_single_poslcscount&#039; );
		}

		if ( get_theme_mod( &#039;penci_btn_gnr_effect&#039; ) ) {
			$classes[] = &#039;penci-btn-e&#039;;
		}

		return $classes;
	}
}

/**
 * Define class for call in javascript when enable lightbox videos for video posts format
 *
 * @since 4.0.3
 */
if (!function_exists(&#039;penci_class_lightbox_enable&#039;)) {
	function penci_class_lightbox_enable() {
		$return = &#039;&#039;;
		$post_id = get_the_ID();

		if (has_post_format(&#039;video&#039;, $post_id) &amp;&amp; get_theme_mod(&#039;penci_grid_lightbox_video&#039;)) {
			$penci_video_data = get_post_meta($post_id, &#039;_format_video_embed&#039;, true);
			if ($penci_video_data) {
				$return = &#039; penci-other-layouts-lighbox&#039;;
			}
		}

		return $return;
	}
}

/**
 * Define permalink for enable lightbox videos for video posts format
 *
 * @since 4.0.3
 */
if (!function_exists(&#039;penci_permalink_fix&#039;)) {
	function penci_permalink_fix() {
		$return = get_the_permalink();
		$post_id = get_the_ID();

		if (has_post_format(&#039;video&#039;, $post_id) &amp;&amp; get_theme_mod(&#039;penci_grid_lightbox_video&#039;)) {
			$penci_video_data = get_post_meta($post_id, &#039;_format_video_embed&#039;, true);
			if ($penci_video_data) {
				if (wp_oembed_get($penci_video_data)) {
					$return = $penci_video_data;
				} elseif (strpos($penci_video_data, &#039;youtube.com&#039;) &gt; 0) {
					preg_match(&#039;/embed\/([\w+\-+]+)[\&quot;\?]/&#039;, $penci_video_data, $matches);
					if ($matches[1]) {
						$return = &#039;https://www.youtube.com/watch?v=&#039; . $matches[1];
					}
				} elseif (strpos($penci_video_data, &#039;vimeo.com&#039;) &gt; 0) {
					preg_match(&#039;/player\.vimeo\.com\/video\/([0-9]*)/&#039;, $penci_video_data, $matches);
					if ($matches[1]) {
						$return = &#039;https://vimeo.com/&#039; . $matches[1];
					}
				}
			}
		}

		echo $return;
	}
}

/**
 * Penci Allow HTML use in data validation wp_kses()
 *
 * @return array HTML allow
 *@since 1.0
 */
if (!function_exists(&#039;penci_allow_html&#039;)) {
	function penci_allow_html() {
		$return = array(
			&#039;a&#039; =&gt; array(
				&#039;href&#039; =&gt; array(),
				&#039;title&#039; =&gt; array(),
				&#039;target&#039; =&gt; array(),
				&#039;title&#039; =&gt; array(),
			),
			&#039;div&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;ul&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;ol&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;li&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;br&#039; =&gt; array(),
			&#039;h1&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;h2&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;h3&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;h4&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;h5&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;h6&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;img&#039; =&gt; array(
				&#039;alt&#039; =&gt; array(),
				&#039;src&#039; =&gt; array(),
				&#039;title&#039; =&gt; array(),
			),
			&#039;em&#039; =&gt; array(),
			&#039;b&#039; =&gt; array(),
			&#039;i&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;strong&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
			&#039;span&#039; =&gt; array(
				&#039;class&#039; =&gt; array(),
				&#039;id&#039; =&gt; array(),
			),
		);

		return $return;
	}
}

/**
 * Get categories array
 *
 * @return array $categories
 *@since 1.0
 */
if (!function_exists(&#039;penci_list_categories&#039;)) {
	function penci_list_categories() {
		$categories = get_categories(
			array(
				&#039;hide_empty&#039; =&gt; 0,
			)
		);

		$return = array();
		foreach ($categories as $cat) {
			$return[$cat-&gt;cat_name] = $cat-&gt;term_id;
		}

		return $return;
	}
}

/**
 * Modify more tag
 *
 * @return new markup more tags
 *@since 1.0
 */
if (!function_exists(&#039;penci_modify_more_tags&#039;)) {
	/**
	 * @param $link
	 *
	 * @return string
	 */
	function penci_modify_more_tags($link) {

		$class = &#039;penci-more-link&#039;;
		if (get_theme_mod(&#039;penci_standard_continue_reading_button&#039;)):
			$class = &#039;penci-more-link penci-more-link-button&#039;;
		endif;

		return &#039;&lt;div class=&quot;&#039; . $class . &#039;&quot;&gt;&#039; . $link . &#039;&lt;/div&gt;&#039;;
	}

	add_filter(&#039;the_content_more_link&#039;, &#039;penci_modify_more_tags&#039;);
}

/**
 * Include Files
 *
 * @return void
 *@since 1.0
 */

// Customizer
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/customizer/default.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/customizer/sanitizing.php&#039;;
include trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/customizer/framework/bootstrap.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/customizer/generate-css-file.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/customizer/style.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/customizer/customizer-tools/autoload.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/darkmode.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/customizer/style-page-header-title.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/customizer/style-page-header-transparent.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/fonts/fonts.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/fonts_loader.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/featured_slider/featured_slider.php&#039;;
// Modules
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/installations/installations.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/detect_mobile.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/theme-updates.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/modules/penci-render.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/modules/penci-walker.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/modules/svg-social.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/template-function.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/extra.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/videos-playlist.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/weather.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/login-popup.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/popup.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/exit_intent.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/live_visitor.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/article_feedback.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/push_notification.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/age-verify.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/social-counter/social-counter.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/rest_api.php&#039;;

if (is_admin()) {
	include trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/auto-thumbnail.php&#039;;
}

// Widgets
if (!function_exists(&#039;penci_use_widget_title_html&#039;)) {
	add_action(&#039;init&#039;, &#039;penci_use_widget_title_html&#039;, 999);
	function penci_use_widget_title_html() {
		remove_filter(&#039;widget_title&#039;, &#039;esc_html&#039;);
	}
}
require penci_locate_template( &#039;inc/widgets/social_widget.php&#039;);
require penci_locate_template( &#039;inc/widgets/about_widget.php&#039;);
require penci_locate_template( &#039;inc/widgets/lastest_post_widget.php&#039;);
require penci_locate_template( &#039;inc/widgets/popular_post_widget.php&#039;);
require penci_locate_template( &#039;inc/widgets/block_heading.php&#039;);
require penci_locate_template( &#039;inc/widgets/facebook_widget.php&#039;);
require penci_locate_template( &#039;inc/widgets/related_post_widget.php&#039;);
require penci_locate_template( &#039;inc/widgets/posts_slider_widget.php&#039;);
require penci_locate_template( &#039;inc/widgets/quote_widget.php&#039;);
require penci_locate_template( &#039;inc/widgets/pinterest_widget.php&#039;);
require penci_locate_template( &#039;inc/widgets/patreon.php&#039;);
require penci_locate_template( &#039;inc/widgets/buymeacoffee.php&#039;);
require penci_locate_template( &#039;inc/widgets/list_banner.php&#039;);
require penci_locate_template( &#039;inc/widgets/login_register_widgets.php&#039;);
require penci_locate_template( &#039;inc/widgets/video_playlist.php&#039;);
require penci_locate_template( &#039;inc/widgets/social_counter.php&#039;);
require penci_locate_template( &#039;inc/widgets/advanced_categories.php&#039;);
require penci_locate_template( &#039;inc/widgets/categories_stylist.php&#039;);
require penci_locate_template( &#039;inc/widgets/authors_list.php&#039;);
require penci_locate_template( &#039;inc/widgets/posts_tabs.php&#039;);
require penci_locate_template( &#039;inc/widgets/search_box.php&#039;);
require penci_locate_template( &#039;inc/widgets/snapchat.php&#039;);
require penci_locate_template( &#039;inc/widgets/tiktok_embed.php&#039;);
require penci_locate_template( &#039;inc/widgets/comments.php&#039;);
require penci_locate_template( &#039;inc/widgets/stylisted_articles_count.php&#039;);
require penci_locate_template( &#039;inc/widgets/weather.php&#039;);
require penci_locate_template( &#039;inc/widgets/flickr.php&#039;);
require penci_locate_template( &#039;inc/widgets/mailchimp.php&#039;);
require penci_locate_template( &#039;inc/widgets/quick_contact.php&#039;);
require penci_locate_template( &#039;inc/widgets/taxonomy_listing.php&#039;);
require penci_locate_template( &#039;inc/widgets-ajax.php&#039;);
if (defined(&#039;WEBSTORIES_VERSION&#039;)) {
	require penci_locate_template(&#039;inc/widgets/web_stories.php&#039;);
}

if (defined(&#039;PENCI_SOLEDAD_SOCIAL_FEED&#039;)) {
	require penci_locate_template(&#039;inc/widgets/latest_tweets.php&#039;);
}

// Like post
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/like_post/post-like.php&#039;;

// Meta box
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/meta-box/meta-box.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/meta-box/categories-meta-box.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/custom-sidebar.php&#039;;

/**
 * Register main sidebar and sidebars in footer
 *
 * @return void
 * @since 1.0
 * @mod 8.6.5
 */
if (!function_exists(&#039;penci_register_sidebar&#039;)) {
	add_action( &#039;widgets_init&#039;, &#039;penci_register_sidebar&#039; );
	function penci_register_sidebar(){
		register_sidebar(
			array(
				&#039;name&#039; =&gt; esc_html__(&#039;Main Sidebar&#039;, &#039;soledad&#039;),
				&#039;id&#039; =&gt; &#039;main-sidebar&#039;,
				&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
				&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
				&#039;before_title&#039; =&gt; &#039;&lt;h3 class=&quot;widget-title penci-border-arrow&quot;&gt;&lt;span class=&quot;inner-arrow&quot;&gt;&#039;,
				&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/h3&gt;&#039;,
			)
		);

		register_sidebar(
			array(
				&#039;name&#039; =&gt; esc_html__(&#039;Main Sidebar Left&#039;, &#039;soledad&#039;),
				&#039;id&#039; =&gt; &#039;main-sidebar-left&#039;,
				&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
				&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
				&#039;before_title&#039; =&gt; &#039;&lt;h3 class=&quot;widget-title penci-border-arrow&quot;&gt;&lt;span class=&quot;inner-arrow&quot;&gt;&#039;,
				&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/h3&gt;&#039;,
			)
		);

		for ($i = 1; $i &lt;= 4; $i++) {
			register_sidebar(
				array(
					&#039;name&#039; =&gt; sprintf(esc_html__(&#039;Footer Column #%s&#039;, &#039;soledad&#039;), $i),
					&#039;id&#039; =&gt; &#039;footer-&#039; . $i,
					&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
					&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
					&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;widget-title penci-border-arrow&quot;&gt;&lt;span class=&quot;inner-arrow&quot;&gt;&#039;,
					&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/h4&gt;&#039;,
				)
			);
		}

		register_sidebar(
			array(
				&#039;name&#039; =&gt; esc_html__(&#039;Header Signup Form&#039;, &#039;soledad&#039;),
				&#039;id&#039; =&gt; &#039;header-signup-form&#039;,
				&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
				&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
				&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;header-signup-form&quot;&gt;&#039;,
				&#039;after_title&#039; =&gt; &#039;&lt;/h4&gt;&#039;,
				&#039;description&#039; =&gt; &#039;Only use for MailChimp Sign-Up Form widget. Display your Sign-Up Form widget below the header. Please use markup we provide here: https://soledad.pencidesign.net/soledad-document/#widgets to display exact&#039;,
			)
		);

		register_sidebar(
			array(
				&#039;name&#039; =&gt; esc_html__(&#039;Footer Signup Form&#039;, &#039;soledad&#039;),
				&#039;id&#039; =&gt; &#039;footer-signup-form&#039;,
				&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
				&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
				&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;footer-subscribe-title&quot;&gt;&#039;,
				&#039;after_title&#039; =&gt; &#039;&lt;/h4&gt;&#039;,
				&#039;description&#039; =&gt; &#039;Only use for MailChimp Sign-Up Form widget. Display your Sign-Up Form widget below on the footer. Please use markup we provide here: https://soledad.pencidesign.net/soledad-document/#widgets to display exact&#039;,
			)
		);

		register_sidebar(
			array(
				&#039;name&#039; =&gt; esc_html__(&#039;Footer Instagram&#039;, &#039;soledad&#039;),
				&#039;id&#039; =&gt; &#039;footer-instagram&#039;,
				&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
				&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
				&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;footer-instagram-title&quot;&gt;&lt;span&gt;&lt;span class=&quot;title&quot;&gt;&#039;,
				&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&#039;,
				&#039;description&#039; =&gt; esc_html__(&#039;Only use for Instagram Slider widget. Display instagram images on your website footer&#039;, &#039;soledad&#039;),
			)
		);

		register_sidebar(
			array(
				&#039;name&#039; =&gt; esc_html__(&#039;Top Instagram&#039;, &#039;soledad&#039;),
				&#039;id&#039; =&gt; &#039;top-instagram&#039;,
				&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
				&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
				&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;footer-instagram-title top-instagram-title&quot;&gt;&lt;span&gt;&lt;span class=&quot;title&quot;&gt;&#039;,
				&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&#039;,
				&#039;description&#039; =&gt; esc_html__(&#039;Only use for Instagram Slider widget. Display instagram images on the top of your website&#039;, &#039;soledad&#039;),
			)
		);

		register_sidebar(
			array(
				&#039;name&#039; =&gt; esc_html__(&#039;Sidebar Hamburger Widgets Above Menu&#039;, &#039;soledad&#039;),
				&#039;id&#039; =&gt; &#039;menu_hamburger_1&#039;,
				&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
				&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
				&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;widget-title penci-border-arrow&quot;&gt;&lt;span class=&quot;inner-arrow&quot;&gt;&#039;,
				&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/h4&gt;&#039;,
			)
		);

		register_sidebar(
			array(
				&#039;name&#039; =&gt; esc_html__(&#039;Sidebar Hamburger Widgets Below Menu&#039;, &#039;soledad&#039;),
				&#039;id&#039; =&gt; &#039;menu_hamburger_2&#039;,
				&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
				&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
				&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;widget-title penci-border-arrow&quot;&gt;&lt;span class=&quot;inner-arrow&quot;&gt;&#039;,
				&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/h4&gt;&#039;,
			)
		);

		register_sidebar(
			array(
				&#039;name&#039; =&gt; esc_html__(&#039;Sidebar For Shop Page &amp; Shop Archive&#039;, &#039;soledad&#039;),
				&#039;id&#039; =&gt; &#039;penci-shop-sidebar&#039;,
				&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
				&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
				&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;widget-title penci-border-arrow&quot;&gt;&lt;span class=&quot;inner-arrow&quot;&gt;&#039;,
				&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/h4&gt;&#039;,
				&#039;description&#039; =&gt; &#039;This sidebar for Shop Page &amp; Shop Archive, if this sidebar is empty, will display Main Sidebar&#039;,
			)
		);

		register_sidebar(
			array(
				&#039;name&#039; =&gt; esc_html__(&#039;Sidebar For Single Product&#039;, &#039;soledad&#039;),
				&#039;id&#039; =&gt; &#039;penci-shop-single&#039;,
				&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
				&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
				&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;widget-title penci-border-arrow&quot;&gt;&lt;span class=&quot;inner-arrow&quot;&gt;&#039;,
				&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/h4&gt;&#039;,
				&#039;description&#039; =&gt; &#039;This sidebar for Single Product, if this sidebar is empty, will display Main Sidebar&#039;,
			)
		);

		if (class_exists(&#039;bbPress&#039;)) {
			register_sidebar(
				array(
					&#039;name&#039; =&gt; esc_html__(&#039;Sidebar For BbPress&#039;, &#039;soledad&#039;),
					&#039;id&#039; =&gt; &#039;penci-bbpress&#039;,
					&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
					&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
					&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;widget-title penci-border-arrow&quot;&gt;&lt;span class=&quot;inner-arrow&quot;&gt;&#039;,
					&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/h4&gt;&#039;,
					&#039;description&#039; =&gt; &#039;This sidebar for Single Product, if this sidebar is empty, will display Main Sidebar&#039;,
				)
			);
		}

		if (class_exists(&#039;BuddyPress&#039;)) {
			register_sidebar(
				array(
					&#039;name&#039; =&gt; esc_html__(&#039;Sidebar For BuddyPress&#039;, &#039;soledad&#039;),
					&#039;id&#039; =&gt; &#039;penci-buddypress&#039;,
					&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
					&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
					&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;widget-title penci-border-arrow&quot;&gt;&lt;span class=&quot;inner-arrow&quot;&gt;&#039;,
					&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/h4&gt;&#039;,
					&#039;description&#039; =&gt; &#039;This sidebar for Single Product, if this sidebar is empty, will display Main Sidebar&#039;,
				)
			);
		}

		for ($i = 1; $i &lt;= 10; $i++) {
			register_sidebar(
				array(
					&#039;name&#039; =&gt; sprintf(esc_html__(&#039;Custom Sidebar %s&#039;, &#039;soledad&#039;), $i),
					&#039;id&#039; =&gt; &#039;custom-sidebar-&#039; . $i,
					&#039;before_widget&#039; =&gt; &#039;&lt;aside id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,
					&#039;after_widget&#039; =&gt; &#039;&lt;/aside&gt;&#039;,
					&#039;before_title&#039; =&gt; &#039;&lt;h4 class=&quot;widget-title penci-border-arrow&quot;&gt;&lt;span class=&quot;inner-arrow&quot;&gt;&#039;,
					&#039;after_title&#039; =&gt; &#039;&lt;/span&gt;&lt;/h4&gt;&#039;,
				)
			);
		}
	}
}

/**
 * Modify category widget defaults
 * Hook to wp_list_categories
 *
 * @since 1.0
 */
if (!function_exists(&#039;penci_add_more_span_cat_count&#039;)) {
	add_filter(&#039;wp_list_categories&#039;, &#039;penci_add_more_span_cat_count&#039;);
	function penci_add_more_span_cat_count($links) {

		$links = preg_replace(&#039;/&lt;\/a&gt; \(([0-9.,]+)\)/&#039;, &#039; &lt;span class=&quot;category-item-count&quot;&gt;(\\1)&lt;/span&gt;&lt;/a&gt;&#039;, $links);

		return $links;
	}
}

/**
 * Custom number posts per page on homepage
 *
 * @return void
 *@since 1.0
 */
if (get_theme_mod(&#039;penci_home_lastest_posts_numbers&#039;)) {
	if (!function_exists(&#039;penci_custom_posts_per_page_for_home&#039;)) {
		function penci_custom_posts_per_page_for_home($query) {
			$blog_posts = get_option(&#039;posts_per_page &#039;);
			$posts_page = get_theme_mod(&#039;penci_home_lastest_posts_numbers&#039;);
			if (is_numeric($posts_page) &amp;&amp; $posts_page &gt; 0 &amp;&amp; $posts_page != $blog_posts) {
				if ($query-&gt;is_home() &amp;&amp; $query-&gt;is_main_query()) {
					$query-&gt;set(&#039;posts_per_page&#039;, $posts_page);
				}
			}
		}

		add_action(&#039;pre_get_posts&#039;, &#039;penci_custom_posts_per_page_for_home&#039;);
	}
}

/**
 * Custom number posts per page on portfolio
 *
 * @return void
 *@since 1.0
 */
if (!function_exists(&#039;penci_portfolio_posts_numbers&#039;)) {
	function penci_portfolio_posts_numbers($query) {
		$blog_posts = get_option(&#039;posts_per_page &#039;);
		if ($query-&gt;is_tax(&#039;portfolio-category&#039;) &amp;&amp; $query-&gt;is_main_query()) {
			$query-&gt;set(&#039;posts_per_page&#039;, $blog_posts);
		}
	}

	add_action(&#039;pre_get_posts&#039;, &#039;penci_portfolio_posts_numbers&#039;);
}

/**
 * Custom orderby &amp; order post
 *
 * @return void
 *@since 1.0
 */
if (!function_exists(&#039;penci_custom_posts_oderby&#039;)) {
	function penci_custom_posts_oderby($query) {
		if (($query-&gt;is_home() &amp;&amp; $query-&gt;is_main_query()) || ($query-&gt;is_archive() &amp;&amp; $query-&gt;is_main_query())) {
			$orderby = get_theme_mod(&#039;penci_general_post_orderby&#039;);
			if (!$orderby):
				$orderby = &#039;date&#039;;
			endif;
			$order = get_theme_mod(&#039;penci_general_post_order&#039;);
			if (!$order):
				$order = &#039;DESC&#039;;
			endif;

			if (!function_exists(&#039;is_woocommerce&#039;) || (function_exists(&#039;is_woocommerce&#039;) &amp;&amp; !is_woocommerce())) {
				$query-&gt;set(&#039;orderby&#039;, $orderby);
				$query-&gt;set(&#039;order&#039;, $order);
			}
		}
	}

	add_action(&#039;pre_get_posts&#039;, &#039;penci_custom_posts_oderby&#039;);
}

/**
 * Adds a lightbox effect to images in single posts using a filter.
 * Hooks into the `the_content()` function to modify image links.
 *
 * @since 1.0
 * @modified 6.8.4
 */
if (!function_exists(&#039;penci_filter_image_attr&#039;)) {
	
	add_filter(&#039;the_content&#039;, &#039;penci_filter_image_attr&#039;, 20);

	function penci_filter_image_attr($content) {
		// Check if the lightbox is disabled
		if (get_theme_mod(&#039;penci_disable_lightbox_single&#039;)) {
			return $content;
		}

		// Only apply on single posts/pages
		if (is_home() || is_archive()) {
			return $content;
		}

		// Quick check to see if content contains &lt;a&gt; and &lt;img&gt; tags before running regex
		if (strpos($content, &#039;&lt;a&#039;) === false || strpos($content, &#039;&lt;img&#039;) === false) {
			return $content;
		}

		// Use preg_replace_callback for better efficiency
		return preg_replace_callback(
			&#039;/&lt;a([^&gt;]+)href=([&quot;\&#039;])([^&quot;\&#039;]+\.(?:bmp|gif|jpeg|jpg|png))\2([^&gt;]*)&gt;\s*&lt;img/i&#039;,
			function ($matches) {
				// Reconstruct &lt;a&gt; tag with the additional data attribute
				return &#039;&lt;a&#039; . $matches[1] . &#039;href=&#039; . $matches[2] . $matches[3] . $matches[2] . &#039; data-rel=&quot;penci-gallery-image-content&quot; &#039; . $matches[4] . &#039;&gt;&lt;img&#039;;
			},
			$content
		);
	}

}

/**
 * Pagination next post and previous post
 *
 * @return void
 *@since 1.0
 */
if (!function_exists(&#039;penci_soledad_archive_pag_style&#039;)):
	function penci_soledad_archive_pag_style($layout_this) {

		if (get_theme_mod(&#039;penci_archive_nav_ajax&#039;) || get_theme_mod(&#039;penci_archive_nav_scroll&#039;)) {

			$button_class = &#039;penci-ajax-more penci-ajax-arch&#039;;
			if (get_theme_mod(&#039;penci_archive_nav_scroll&#039;)) {
				$button_class .= &#039; penci-infinite-scroll&#039;;
			}

			$data_layout = $layout_this;
			if (in_array($layout_this, array(&#039;standard-grid&#039;, &#039;classic-grid&#039;, &#039;overlay-grid&#039;))) {
				$data_layout = &#039;grid&#039;;
			} elseif (in_array($layout_this, array(&#039;standard-grid-2&#039;, &#039;classic-grid-2&#039;))) {
			$data_layout = &#039;grid-2&#039;;
		} elseif (in_array($layout_this, array(&#039;standard-list&#039;, &#039;classic-list&#039;, &#039;overlay-list&#039;))) {
			$data_layout = &#039;list&#039;;
		} elseif (in_array($layout_this, array(&#039;standard-boxed-1&#039;, &#039;classic-boxed-1&#039;))) {
			$data_layout = &#039;boxed-1&#039;;
		} elseif (in_array($layout_this, array(&#039;mixed-3&#039;, &#039;mixed-4&#039;))) {
			$data_layout = &#039;small-list&#039;;
		}

		$data_template = &#039;sidebar&#039;;
		if (!penci_get_setting(&#039;penci_sidebar_archive&#039;)):
			$data_template = &#039;no-sidebar&#039;;
		endif;

		$offset_number = get_option(&#039;posts_per_page&#039;);

		$penci_cat_featured_layout = get_theme_mod(&#039;penci_cat_featured_layout&#039;, &#039;&#039;);
		$penci_tag_featured_layout = get_theme_mod(&#039;penci_tag_featured_layout&#039;, &#039;&#039;);

		if ((is_category() &amp;&amp; $penci_cat_featured_layout) || (is_tag() &amp;&amp; $penci_tag_featured_layout)) {
			$penci_featured_layout = is_category() ? $penci_cat_featured_layout : $penci_tag_featured_layout;
			$grid_per_page = penci_featured_archive_ppl($penci_featured_layout);
			$offset_number = $offset_number + $grid_per_page;
		}

		$num_load = 6;
		if (get_theme_mod(&#039;penci_arc_number_load_more&#039;) &amp;&amp; 0 != get_theme_mod(&#039;penci_arc_number_load_more&#039;)):
			$num_load = get_theme_mod(&#039;penci_arc_number_load_more&#039;);
		endif;
		?&gt;
			&lt;?php

		$data_archive_type = &#039;&#039;;
		$data_archive_value = &#039;&#039;;
		if (is_category()):
			$category = get_category(get_query_var(&#039;cat&#039;));
			$cat_id = isset($category-&gt;cat_ID) ? $category-&gt;cat_ID : &#039;&#039;;
			$data_archive_type = &#039;cat&#039;;
			$data_archive_value = $cat_id;
			$opt_cat = &#039;category_&#039; . $cat_id;
			$cat_meta = get_option($opt_cat);
			$sidebar_opts = isset($cat_meta[&#039;cat_sidebar_display&#039;]) ? $cat_meta[&#039;cat_sidebar_display&#039;] : &#039;&#039;;
			if ($sidebar_opts == &#039;no&#039;):
				$data_template = &#039;no-sidebar&#039;;
			elseif ($sidebar_opts == &#039;left&#039; || $sidebar_opts == &#039;right&#039;):
				$data_template = &#039;sidebar&#039;;
			endif;

		elseif (is_tag()):
			$tag = get_queried_object();
			$tag_id = isset($tag-&gt;term_id) ? $tag-&gt;term_id : &#039;&#039;;
			$data_archive_type = &#039;tag&#039;;
			$data_archive_value = $tag_id;
		elseif (is_day()):
			$data_archive_type = &#039;day&#039;;
			$data_archive_value = get_the_date(&#039;m|d|Y&#039;);
		elseif (is_month()):
			$data_archive_type = &#039;month&#039;;
			$data_archive_value = get_the_date(&#039;m|d|Y&#039;);
		elseif (is_year()):
			$data_archive_type = &#039;year&#039;;
			$data_archive_value = get_the_date(&#039;m|d|Y&#039;);
		elseif (is_search()):
			$data_archive_type = &#039;search&#039;;
			$data_archive_value = get_search_query();
		elseif (is_author()):

			global $authordata;
			$user_id = isset($authordata-&gt;ID) ? $authordata-&gt;ID : 0;

			$data_archive_type = &#039;author&#039;;
			$data_archive_value = $user_id;
		elseif (is_archive()):
			$queried_object = get_queried_object();
			$term_id = isset($queried_object-&gt;term_id) ? $queried_object-&gt;term_id : &#039;&#039;;
			$tax = isset( $queried_object-&gt;taxonomy ) ? $queried_object-&gt;taxonomy: &#039;&#039;;
			$tax_name = is_object($tax) &amp;&amp; isset($tax-&gt;name) ? $tax-&gt;name : &#039;&#039;;

			if ($term_id &amp;&amp; $tax_name) {
				$data_archive_type = $tax_name;
				$data_archive_value = $term_id;
			}
		endif;

		$button_data = &#039;data-mes=&quot;&#039; . penci_get_setting(&#039;penci_trans_no_more_posts&#039;) . &#039;&quot;&#039;;
		$button_data .= &#039; data-layout=&quot;&#039; . esc_attr($data_layout) . &#039;&quot;&#039;;
		$button_data .= &#039; data-number=&quot;&#039; . absint($num_load) . &#039;&quot;&#039;;
		$button_data .= &#039; data-offset=&quot;&#039; . absint($offset_number) . &#039;&quot;&#039;;
		$button_data .= &#039; data-from=&quot;customize&quot;&#039;;
		$button_data .= &#039; data-template=&quot;&#039; . $data_template . &#039;&quot;&#039;;
		$button_data .= &#039; data-archivetype=&quot;&#039; . $data_archive_type . &#039;&quot;&#039;;
		$button_data .= &#039; data-archivevalue=&quot;&#039; . $data_archive_value . &#039;&quot;&#039;;
		?&gt;
		&lt;div class=&quot;penci-pagination &lt;?php echo $button_class; ?&gt;&quot;&gt;
			&lt;a href=&quot;#&quot; aria-label=&quot;Load More Posts&quot; class=&quot;penci-ajax-more-button&quot; &lt;?php echo $button_data; ?&gt; data-order=&quot;&lt;?php echo esc_attr( get_query_var(&#039;pc_archive_sort&#039;, &#039;desc&#039;) ); ?&gt;&quot; data-md=&quot;&lt;?php echo esc_attr( get_query_var(&#039;pc_archive_month&#039;, &#039;&#039;) ); ?&gt;&quot;&gt;
				&lt;span class=&quot;ajax-more-text&quot;&gt;&lt;?php echo penci_get_setting(&#039;penci_trans_load_more_posts&#039;); ?&gt;&lt;/span&gt;
				&lt;span class=&quot;ajaxdot&quot;&gt;&lt;/span&gt;&lt;?php penci_fawesome_icon(&#039;fas fa-sync&#039;);?&gt;
			&lt;/a&gt;
		&lt;/div&gt;
			&lt;?php
} else {
		penci_soledad_pagination();
	}
}
endif;

if (!function_exists(&#039;penci_soledad_pagination&#039;)) {
	function penci_soledad_pagination() {

		if ( get_theme_mod(&#039;penci_page_navigation_numbers&#039;) ) {
			if ( ( is_archive() || is_front_page() || is_home() ) &amp;&amp; get_theme_mod( &#039;penci_archive_ajax_navigation&#039; ) ) {
				echo penci_get_html_animation_loading( &#039;df&#039; );
			}
			echo penci_pagination_numbers();
		} else {
			global $wp_query;
			if ( $wp_query-&gt;max_num_pages &gt; 1 ):
			?&gt;
				&lt;div class=&quot;penci-pagination&quot;&gt;
					&lt;div class=&quot;newer&quot;&gt;
						&lt;?php if (get_previous_posts_link()) {?&gt;
							&lt;?php previous_posts_link(&#039;&lt;span&gt;&#039; . penci_icon_by_ver(&#039;fas fa-angle-left&#039;) . penci_get_setting(&#039;penci_trans_newer_posts&#039;) . &#039;&lt;/span&gt;&#039;);?&gt;
						&lt;?php } else {?&gt;
							&lt;?php echo &#039;&lt;div class=&quot;disable-url&quot;&gt;&lt;span&gt;&#039; . penci_icon_by_ver(&#039;fas fa-angle-left&#039;) . penci_get_setting(&#039;penci_trans_newer_posts&#039;) . &#039;&lt;/span&gt;&lt;/div&gt;&#039;; ?&gt;
						&lt;?php }?&gt;
					&lt;/div&gt;
					&lt;div class=&quot;older&quot;&gt;
						&lt;?php if (get_next_posts_link()) {?&gt;
							&lt;?php next_posts_link(&#039;&lt;span&gt;&#039; . penci_get_setting(&#039;penci_trans_older_posts&#039;) . &#039; &#039; . penci_icon_by_ver(&#039;fas fa-angle-right&#039;) . &#039;&lt;/span&gt;&#039;);?&gt;
						&lt;?php } else {?&gt;
							&lt;?php echo &#039;&lt;div class=&quot;disable-url&quot;&gt;&lt;span&gt;&#039; . penci_get_setting(&#039;penci_trans_older_posts&#039;) . &#039; &#039; . penci_icon_by_ver(&#039;fas fa-angle-right&#039;) . &#039;&lt;/span&gt;&lt;/div&gt;&#039;; ?&gt;
						&lt;?php }?&gt;
					&lt;/div&gt;
				&lt;/div&gt;
				&lt;?php
endif;
		}
	}
}

/**
 * Pagination numbers
 *
 * @return void
 *@since 1.0
 */
if (!function_exists(&#039;penci_pagination_numbers&#039;)) {
	function penci_pagination_numbers($custom_query = false, $align = null) {
		global $wp_query;
		if (!$custom_query) {
			$custom_query = $wp_query;}
		$paged_get = &#039;paged&#039;;
		if (is_front_page() &amp;&amp; !is_home()):
			$paged_get = &#039;page&#039;;
		endif;

		$found_posts = $custom_query-&gt;found_posts;
		$posts_per_page = isset($custom_query-&gt;query[&#039;posts_per_page&#039;]) ? $custom_query-&gt;query[&#039;posts_per_page&#039;] : get_option(&#039;posts_per_page&#039;);

		if (isset($custom_query-&gt;query[&#039;offset&#039;]) &amp;&amp; $custom_query-&gt;query[&#039;offset&#039;] &gt; 0) {

			$offset = $custom_query-&gt;query[&#039;offset&#039;];
			$current_paged = max(1, get_query_var($paged_get));

			if ($current_paged &gt; 1) {
				$offset = $offset - ($posts_per_page * ($current_paged - 1));
			}

			$total_pages = ceil(($found_posts - $offset) / $posts_per_page);
			$custom_query-&gt;max_num_pages = $total_pages;
		}
		$pagination = paginate_links(
			array(
				&#039;current&#039; =&gt; max(1, get_query_var($paged_get)),
				&#039;total&#039; =&gt; $custom_query-&gt;max_num_pages,
				&#039;type&#039; =&gt; &#039;list&#039;,
				&#039;prev_text&#039; =&gt; penci_icon_by_ver(&#039;fas fa-angle-left&#039;),
				&#039;next_text&#039; =&gt; penci_icon_by_ver(&#039;fas fa-angle-right&#039;),
			)
		);

		$pagenavi_align = get_theme_mod(&#039;penci_page_navigation_align&#039;) ? get_theme_mod(&#039;penci_page_navigation_align&#039;) : &#039;align-left&#039;;
		if ($align):
			$pagenavi_align = $align;
		endif;

		if ($pagination) {
			return &#039;&lt;div class=&quot;penci-pagination &#039; . esc_attr($pagenavi_align) . &#039;&quot;&gt;&#039; . $pagination . &#039;&lt;/div&gt;&#039;;
		}
	}
}

/**
 * Comments template
 *
 * @return void
 *@since 1.0
 */
if (!function_exists(&#039;penci_comments_template&#039;)) {
	function penci_comments_template($comment, $args, $depth) {
		$GLOBALS[&#039;comment&#039;] = $comment;

		$attr_date = &#039;datetime=&quot;&#039; . get_comment_time(&#039;Y-m-d\TH:i:sP&#039;) . &#039;&quot;&#039;;
		$attr_date .= &#039;title=&quot;&#039; . get_comment_time(&#039;l, F j, Y, g:i a&#039;) . &#039;&quot;&#039;;
		$attr_date .= &#039;itemprop=&quot;commentTime&quot;&#039;;

		$rating = get_comment_meta(get_comment_ID(), &#039;pccm_rating&#039;, true);
		$pccm_rating_title = get_comment_meta(get_comment_ID(), &#039;pccm_rating_title&#039;, true);

		$is_review = $rating &amp;&amp; $pccm_rating_title &amp;&amp; get_theme_mod(&#039;penci_post_comments_ratings&#039;);

		$before_author = $after_author = &#039;&#039;;
		if ($is_review) {
			$before_author = &#039;&lt;div class=&quot;penci-review-author&quot;&gt;&#039;;
			$after_author = &#039;&lt;/div&gt;&#039;;
		}
		?&gt;
		&lt;div &lt;?php comment_class();?&gt; id=&quot;comment-&lt;?php comment_ID();?&gt;&quot; itemprop=&quot;&quot; itemscope=&quot;itemscope&quot; itemtype=&quot;https://schema.org/UserComments&quot;&gt;
			&lt;meta itemprop=&quot;discusses&quot; content=&quot;&lt;?php echo esc_attr(get_the_title()); ?&gt;&quot;/&gt;
			&lt;link itemprop=&quot;url&quot; href=&quot;#comment-&lt;?php comment_ID();?&gt;&quot;&gt;
			&lt;div class=&quot;thecomment&quot;&gt;
				&lt;div class=&quot;author-img&quot;&gt;
					&lt;?php echo get_avatar($comment, $args[&#039;avatar_size&#039;]); ?&gt;
				&lt;/div&gt;
				&lt;div class=&quot;comment-text&quot;&gt;

					&lt;?php if ($is_review): ?&gt;
					&lt;div class=&quot;penci-review-summary&quot;&gt;
						&lt;div class=&quot;review_rated&quot;&gt;
						&lt;?php
for ($x = 1; $x &lt;= 5; $x++) {
			$show = $x &lt;= $rating ? &#039;on&#039; : &#039;off&#039;;
			echo &#039;&lt;i data-alt=&quot;&#039; . $x . &#039;&quot; class=&quot;star-&#039; . $show . &#039;-png&quot;&gt;&lt;/i&gt;&#039;;
		}
		?&gt;
						&lt;/div&gt;
						&lt;h3 class=&quot;pccm_rating_title&quot;&gt;&lt;?php echo $pccm_rating_title; ?&gt;&lt;/h3&gt;
					&lt;/div&gt;
					&lt;?php endif;?&gt;
					&lt;?php echo $before_author; ?&gt;
					&lt;span class=&quot;author&quot; itemprop=&quot;creator&quot; itemtype=&quot;https://schema.org/Person&quot;&gt;&lt;span itemprop=&quot;name&quot;&gt;&lt;?php echo get_comment_author_link(); ?&gt;&lt;/span&gt;&lt;/span&gt;
					&lt;span class=&quot;date&quot; &lt;?php echo $attr_date; ?&gt;&gt;&lt;?php penci_fawesome_icon(&#039;far fa-clock&#039;);?&gt;&lt;?php printf(esc_html__(&#039;%1$s - %2$s&#039;, &#039;soledad&#039;), get_comment_date(), get_comment_time());?&gt;&lt;/span&gt;
					&lt;?php echo $after_author; ?&gt;
					&lt;?php if ($comment-&gt;comment_approved == &#039;0&#039;): ?&gt;
						&lt;em&gt;&lt;i class=&quot;icon-info-sign&quot;&gt;&lt;/i&gt; &lt;?php echo penci_get_setting(&#039;penci_trans_wait_approval_comment&#039;); ?&gt;&lt;/em&gt;
					&lt;?php endif;?&gt;
					&lt;div class=&quot;comment-content&quot; itemprop=&quot;commentText&quot;&gt;
						&lt;?php comment_text();?&gt;
					&lt;/div&gt;
					&lt;?php if ( get_theme_mod( &#039;penci_post_comments_lines&#039; ) ): ?&gt;
						&lt;a class=&quot;penci_cmrm&quot; aria-label=&quot;&lt;?php echo penci_get_setting( &#039;penci_trans_read_more&#039; );?&gt;&quot; href=&quot;#comment-&lt;?php comment_ID();?&gt;&quot;&gt;&lt;?php echo penci_get_setting( &#039;penci_trans_read_more&#039; );?&gt;&lt;/a&gt;
					&lt;?php endif;?&gt;
					&lt;span class=&quot;reply&quot;&gt;
						&lt;?php
comment_reply_link(
			array_merge(
				$args,
				array(
					&#039;reply_text&#039; =&gt; penci_get_setting(&#039;penci_trans_reply_comment&#039;),
					&#039;depth&#039; =&gt; $depth,
					&#039;max_depth&#039; =&gt; $args[&#039;max_depth&#039;],
				)
			),
			$comment-&gt;comment_ID
		);
		?&gt;
						&lt;?php edit_comment_link(penci_get_setting(&#039;penci_trans_edit_comment&#039;));?&gt;
					&lt;/span&gt;
				&lt;/div&gt;
			&lt;/div&gt;
		&lt;?php
}
}

/**
 * Author socials url
 *
 * @param array $contactmethods
 *
 * @return new array $contactmethods
 *@since 1.0
 */
if (!function_exists(&#039;penci_author_social&#039;)) {
	function penci_author_social($contactmethods) {
		unset($contactmethods[&#039;googleplus&#039;]);
		$contactmethods[&#039;twitter&#039;] = __(&#039;Twitter Username&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;facebook&#039;] = __(&#039;Facebook Username&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;google&#039;] = __(&#039;Google Plus Username&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;tumblr&#039;] = __(&#039;Tumblr Username&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;instagram&#039;] = __(&#039;Instagram Username&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;linkedin&#039;] = __(&#039;LinkedIn Profile URL&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;pinterest&#039;] = __(&#039;Pinterest Username&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;soundcloud&#039;] = __(&#039;Soundcloud Profile URL&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;youtube&#039;] = __(&#039;Youtube Profile URL&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;tiktok&#039;] = __(&#039;TikTok Profile URL&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;telegram&#039;] = __(&#039;Telegram Profile URL&#039;, &#039;soledad&#039;);
		$contactmethods[&#039;zalo&#039;] = __(&#039;Zalo Number&#039;, &#039;soledad&#039;);

		return $contactmethods;
	}
	add_filter(&#039;user_contactmethods&#039;, &#039;penci_author_social&#039;, 10, 1);
}

/**
 * Featured category to display in top slider
 *
 * @param string $separator
 *
 * @return void
 *@since 1.0
 */
if (!function_exists(&#039;penci_category&#039;)) {
	function penci_category($separator = &#039;&#039;, $show_pricat = null, $featured = false) {

		$show_pricat_only = get_theme_mod(&#039;penci_show_pricat_yoast_only&#039;);
		$show_pricat_first = get_theme_mod(&#039;penci_show_pricat_first_yoast&#039;);

		if ($show_pricat) {
			$show_pricat_only = true;
		}

		$the_category = get_the_category();
		$loop_cats = $the_category;

		$primary_cat = &#039;&#039;;
		$primary_catid = penci_get_primary_cat_id();
		if (($show_pricat_only || $show_pricat_first) &amp;&amp; $primary_catid) {
			$term = get_term($primary_catid);
			if (!is_wp_error($term)) {
				$primary_cat = $term;

				if ($show_pricat_only) {
					$loop_cats = array($term);
				} else {
					$loop_cats = array_merge(array($term), $the_category);
				}
			}
		}

		if (get_theme_mod(&#039;penci_featured_cat_hide&#039;) == true) {

			$excluded_cat = get_theme_mod(&#039;penci_featured_cat&#039;);
			$first_time = 1;

			$count_the_category = count((array) $the_category);

			if ($show_pricat_only &amp; isset($primary_cat-&gt;term_taxonomy_id) &amp;&amp; $primary_cat-&gt;term_taxonomy_id == $excluded_cat &amp;&amp; $count_the_category &gt; 1) {
				$loop_cats = array();
				foreach ($the_category as $cat) {
					if ($loop_cats) {
						continue;
					}

					if (isset($cat-&gt;cat_ID) &amp;&amp; $cat-&gt;cat_ID == $excluded_cat) {
						continue;
					}

					$loop_cats = array($cat);
				}
			}

			$cat_show_arr = array();
			foreach ((array) $loop_cats as $category) {

				$cat_ID = &#039;&#039;;
				if (isset($category-&gt;cat_ID) &amp;&amp; $category-&gt;cat_ID) {
					$cat_ID = $category-&gt;cat_ID;
				} elseif (isset($category-&gt;term_taxonomy_id) &amp;&amp; $category-&gt;term_taxonomy_id) {
					$cat_ID = $category-&gt;term_taxonomy_id;
				}

				if ($cat_ID == $excluded_cat) {
					continue;
				}

				if ($show_pricat_first) {
					if (in_array($category-&gt;term_id, $cat_show_arr)) {
						continue;
					}

					$cat_show_arr[] = $category-&gt;term_id;
				}
				$custom_style = apply_filters(&#039;penci_cat_color&#039;, &#039;&#039;, $category-&gt;term_id, $featured);
				$custombg_style = apply_filters(&#039;penci_cat_bgcolor&#039;, &#039;&#039;, $category-&gt;term_id, $featured);

				if ($first_time == 1) {
					echo &#039;&lt;a style=&quot;&#039; . $custombg_style . &#039;&quot; class=&quot;penci-cat-name penci-cat-&#039; . $category-&gt;term_id . &#039;&quot; href=&quot;&#039; . get_category_link($category-&gt;term_id) . &#039;&quot;  rel=&quot;category tag&quot;&gt;&lt;span style=&quot;&#039; . $custom_style . &#039;&quot;&gt;&#039; . $category-&gt;name . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
					$first_time = 0;
				} else {
					echo wp_kses($separator, penci_allow_html()) . &#039;&lt;a style=&quot;&#039; . $custom_style . &#039;&quot; class=&quot;penci-cat-name penci-cat-&#039; . $category-&gt;term_id . &#039;&quot; href=&quot;&#039; . get_category_link($category-&gt;term_id) . &#039;&quot;  rel=&quot;category tag&quot;&gt;&lt;span&gt;&#039; . $category-&gt;name . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				}
			}
		} else {
			$cat_show_arr = array();
			$first_time = 1;
			foreach ((array) $loop_cats as $category) {
				if ( is_object($category) &amp;&amp; isset( $category-&gt;term_id ) ) {
					if ($show_pricat_first) {
						if (in_array($category-&gt;term_id, $cat_show_arr)) {
							continue;
						}

						$cat_show_arr[] = $category-&gt;term_id;
					}

					$custom_style = apply_filters(&#039;penci_cat_color&#039;, &#039;&#039;, $category-&gt;term_id, $featured);
					$custombg_style = apply_filters(&#039;penci_cat_bgcolor&#039;, &#039;&#039;, $category-&gt;term_id, $featured);

					if ($first_time == 1) {
						echo &#039;&lt;a style=&quot;&#039; . $custombg_style . &#039;&quot; class=&quot;penci-cat-name penci-cat-&#039; . $category-&gt;term_id . &#039;&quot; href=&quot;&#039; . get_category_link($category-&gt;term_id) . &#039;&quot;  rel=&quot;category tag&quot;&gt;&lt;span style=&quot;&#039; . $custom_style . &#039;&quot;&gt;&#039; . $category-&gt;name . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
						$first_time = 0;
					} else {
						echo wp_kses($separator, penci_allow_html()) . &#039;&lt;a style=&quot;&#039; . $custombg_style . &#039;&quot; class=&quot;penci-cat-name penci-cat-&#039; . $category-&gt;term_id . &#039;&quot; href=&quot;&#039; . get_category_link($category-&gt;term_id) . &#039;&quot;  rel=&quot;category tag&quot;&gt;&lt;span style=&quot;&#039; . $custom_style . &#039;&quot;&gt;&#039; . $category-&gt;name . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
					}
				}
			}
		}

		unset($primary_cat, $the_category, $cat_show_arr);
	}
}

/**
 * List all social media data
 */
if (!function_exists(&#039;penci_social_media_array&#039;)) {
	function penci_social_media_array() {
		$array = array(
			&#039;facebook&#039; =&gt; array(penci_get_setting(&#039;penci_facebook&#039;), &#039;fab fa-facebook-f&#039;),
			&#039;twitter&#039; =&gt; array(penci_get_setting(&#039;penci_twitter&#039;), &#039;penciicon-x-twitter&#039;),
			&#039;instagram&#039; =&gt; array(get_theme_mod(&#039;penci_instagram&#039;), &#039;fab fa-instagram&#039;),
			&#039;pinterest&#039; =&gt; array(get_theme_mod(&#039;penci_pinterest&#039;), &#039;fab fa-pinterest&#039;),
			&#039;linkedin&#039; =&gt; array(get_theme_mod(&#039;penci_linkedin&#039;), &#039;fab fa-linkedin-in&#039;),
			&#039;flickr&#039; =&gt; array(get_theme_mod(&#039;penci_flickr&#039;), &#039;fab fa-flickr&#039;),
			&#039;behance&#039; =&gt; array(get_theme_mod(&#039;penci_behance&#039;), &#039;fab fa-behance&#039;),
			&#039;tumblr&#039; =&gt; array(get_theme_mod(&#039;penci_tumblr&#039;), &#039;fab fa-tumblr&#039;),
			&#039;youtube&#039; =&gt; array(get_theme_mod(&#039;penci_youtube&#039;), &#039;fab fa-youtube&#039;),
			&#039;email&#039; =&gt; array(get_theme_mod(&#039;penci_email_me&#039;), &#039;fas fa-envelope&#039;),
			&#039;vk&#039; =&gt; array(get_theme_mod(&#039;penci_vk&#039;), &#039;fab fa-vk&#039;),
			&#039;bloglovin&#039; =&gt; array(get_theme_mod(&#039;penci_bloglovin&#039;), &#039;far fa-heart&#039;),
			&#039;vine&#039; =&gt; array(get_theme_mod(&#039;penci_vine&#039;), &#039;fab fa-vine&#039;),
			&#039;soundcloud&#039; =&gt; array(get_theme_mod(&#039;penci_soundcloud&#039;), &#039;fab fa-soundcloud&#039;),
			&#039;snapchat&#039; =&gt; array(get_theme_mod(&#039;penci_snapchat&#039;), &#039;fab fa-snapchat&#039;),
			&#039;spotify&#039; =&gt; array(get_theme_mod(&#039;penci_spotify&#039;), &#039;fab fa-spotify&#039;),
			&#039;github&#039; =&gt; array(get_theme_mod(&#039;penci_github&#039;), &#039;fab fa-github&#039;),
			&#039;stack-overflow&#039; =&gt; array(get_theme_mod(&#039;penci_stack&#039;), &#039;fab fa-stack-overflow&#039;),
			&#039;twitch&#039; =&gt; array(get_theme_mod(&#039;penci_twitch&#039;), &#039;fab fa-twitch&#039;),
			&#039;vimeo&#039; =&gt; array(get_theme_mod(&#039;penci_vimeo&#039;), &#039;fab fa-vimeo-v&#039;),
			&#039;steam&#039; =&gt; array(get_theme_mod(&#039;penci_steam&#039;), &#039;fab fa-steam&#039;),
			&#039;xing&#039; =&gt; array(get_theme_mod(&#039;penci_xing&#039;), &#039;fab fa-xing&#039;),
			&#039;whatsapp&#039; =&gt; array(get_theme_mod(&#039;penci_whatsapp&#039;), &#039;fab fa-whatsapp&#039;),
			&#039;telegram&#039; =&gt; array(get_theme_mod(&#039;penci_telegram&#039;), &#039;fab fa-telegram&#039;),
			&#039;reddit&#039; =&gt; array(get_theme_mod(&#039;penci_reddit&#039;), &#039;fab fa-reddit-alien&#039;),
			&#039;ok&#039; =&gt; array(get_theme_mod(&#039;penci_ok&#039;), &#039;fab fa-odnoklassniki&#039;),
			&#039;500px&#039; =&gt; array(get_theme_mod(&#039;penci_500px&#039;), &#039;fab fa-500px&#039;),
			&#039;stumbleupon&#039; =&gt; array(get_theme_mod(&#039;penci_stumbleupon&#039;), &#039;fab fa-stumbleupon&#039;),
			&#039;wechat&#039; =&gt; array(get_theme_mod(&#039;penci_wechat&#039;), &#039;fab fa-weixin&#039;),
			&#039;weibo&#039; =&gt; array(get_theme_mod(&#039;penci_weibo&#039;), &#039;fab fa-weibo&#039;),
			&#039;line&#039; =&gt; array(get_theme_mod(&#039;penci_line&#039;), &#039;penciicon-line&#039;),
			&#039;viber&#039; =&gt; array(get_theme_mod(&#039;penci_viber&#039;), &#039;penciicon-viber&#039;),
			&#039;discord&#039; =&gt; array(get_theme_mod(&#039;penci_discord&#039;), &#039;penciicon-discord&#039;),
			&#039;rss&#039; =&gt; array(get_theme_mod(&#039;penci_rss&#039;), &#039;fas fa-rss&#039;),
			&#039;slack&#039; =&gt; array(get_theme_mod(&#039;penci_slack&#039;), &#039;fab fa-slack&#039;),
			&#039;mixcloud&#039; =&gt; array(get_theme_mod(&#039;penci_mixcloud&#039;), &#039;fab fa-mixcloud&#039;),
			&#039;goodreads&#039; =&gt; array(get_theme_mod(&#039;penci_goodreads&#039;), &#039;penciicon-goodreads&#039;),
			&#039;tripadvisor&#039; =&gt; array(get_theme_mod(&#039;penci_tripadvisor&#039;), &#039;fab fa-tripadvisor&#039;),
			&#039;tiktok&#039; =&gt; array(get_theme_mod(&#039;penci_tiktok&#039;), &#039;penciicon-tik-tok&#039;),
			&#039;dailymotion&#039; =&gt; array(get_theme_mod(&#039;penci_dailymotion&#039;), &#039;penciicon-letter-d&#039;),
			&#039;blogger&#039; =&gt; array(get_theme_mod(&#039;penci_blogger&#039;), &#039;penciicon-blogger-1&#039;),
			&#039;delicious&#039; =&gt; array(get_theme_mod(&#039;penci_delicious&#039;), &#039;fab fa-delicious&#039;),
			&#039;deviantart&#039; =&gt; array(get_theme_mod(&#039;penci_deviantart&#039;), &#039;penciicon-deviantart-1&#039;),
			&#039;digg&#039; =&gt; array(get_theme_mod(&#039;penci_digg&#039;), &#039;fab fa-digg&#039;),
			&#039;evernote&#039; =&gt; array(get_theme_mod(&#039;penci_evernote&#039;), &#039;penciicon-evernote&#039;),
			&#039;forrst&#039; =&gt; array(get_theme_mod(&#039;penci_forrst&#039;), &#039;penciicon-forrst&#039;),
			&#039;grooveshark&#039; =&gt; array(get_theme_mod(&#039;penci_grooveshark&#039;), &#039;penciicon-grooveshark&#039;),
			&#039;lastfm&#039; =&gt; array(get_theme_mod(&#039;penci_lastfm&#039;), &#039;penciicon-lastfm&#039;),
			&#039;myspace&#039; =&gt; array(get_theme_mod(&#039;penci_myspace&#039;), &#039;penciicon-myspace-logo&#039;),
			&#039;paypal&#039; =&gt; array(get_theme_mod(&#039;penci_paypal&#039;), &#039;fab fa-paypal&#039;),
			&#039;skype&#039; =&gt; array(get_theme_mod(&#039;penci_skype&#039;), &#039;fab fa-skype&#039;),
			&#039;window&#039; =&gt; array(get_theme_mod(&#039;penci_window&#039;), &#039;fab fa-windows&#039;),
			&#039;wordPress&#039; =&gt; array(get_theme_mod(&#039;penci_wordpress&#039;), &#039;fab fa-wordpress&#039;),
			&#039;yelp&#039; =&gt; array(get_theme_mod(&#039;penci_yelp&#039;), &#039;fab fa-yelp&#039;),
			&#039;yahoo&#039; =&gt; array(get_theme_mod(&#039;penci_yahoo&#039;), &#039;penciicon-yahoo-logo&#039;),
			&#039;yandex&#039; =&gt; array(get_theme_mod(&#039;penci_yandex&#039;), &#039;penciicon-y&#039;),
			&#039;douban&#039; =&gt; array(get_theme_mod(&#039;penci_douban&#039;), &#039;fa fa-qq&#039;),
			&#039;qq&#039; =&gt; array(get_theme_mod(&#039;penci_qq&#039;), &#039;fa fa-qq&#039;),
			&#039;threads&#039; =&gt; array(get_theme_mod(&#039;penci_threads&#039;), &#039;penciicon-threads&#039;),
			&#039;bluesky&#039; =&gt; array(get_theme_mod(&#039;penci_bluesky&#039;), &#039;penciicon-butterfly&#039;),
		);

		$custom_social_icons = get_option(&#039;penci_custom_socials&#039;, array());

		if (!empty($custom_social_icons)) {
			foreach ($custom_social_icons as $name =&gt; $attr) {
				$array[$name] = array($attr[&#039;url&#039;], $attr[&#039;icon&#039;]);
			}
		}

		$custom_order = get_option(&#039;penci_social_orders&#039;);

		if (!empty($custom_order)) {
			$new_order = array();
			foreach ($custom_order as $key =&gt; $name) {
				$new_name = str_replace(array(&#039;penci_&#039;, &#039;email_me&#039;, &#039;stack&#039;, &#039;wordpress&#039;), array(&#039;&#039;, &#039;email&#039;, &#039;stack-overflow&#039;, &#039;wordPress&#039;), $name);
				$new_order[$key] = $new_name;
			}

			$array = penci_sortArrayByArray($array, $new_order);
		}

		return $array;
	}
}
if (!function_exists(&#039;penci_social_penci_icons_array&#039;)) {
	function penci_social_penci_icons_array() {
		return array(&#039;line&#039;, &#039;viber&#039;, &#039;discord&#039;, &#039;goodreads&#039;, &#039;tiktok&#039;, &#039;douban&#039;, &#039;qq&#039;);
	}
}

/**
 * Custom the_excerpt() length function
 *
 * @param number $length of the_excerpt
 *
 * @return new number excerpt length
 *@since 1.0
 */
if (!function_exists(&#039;penci_custom_excerpt_length&#039;)) {
	function penci_custom_excerpt_length($length) {
		$number_excerpt_length = get_theme_mod(&#039;penci_post_excerpt_length&#039;) ? get_theme_mod(&#039;penci_post_excerpt_length&#039;) : 30;
		return $number_excerpt_length;
	}

	add_filter(&#039;excerpt_length&#039;, &#039;penci_custom_excerpt_length&#039;, 999);
}

/**
 * Custom the_excerpt() more string
 *
 * @param string $more
 *
 * @return new more string of the_excerpt() function
 *@since 1.0
 */
if (!function_exists(&#039;penci_new_excerpt_more&#039;)) {
	function penci_new_excerpt_more($more) {
		return &#039;&amp;hellip;&#039;;
	}

	add_filter(&#039;excerpt_more&#039;, &#039;penci_new_excerpt_more&#039;);
}

/**
 * Exclude pages form search results page
 * Hook to init action
 *
 * @return void
 *@since 1.0
 */
if (!function_exists(&#039;penci_remove_pages_from_search&#039;)) {
	add_action(&#039;pre_get_posts&#039;, &#039;penci_remove_pages_from_search&#039;);
	function penci_remove_pages_from_search($query) {

		if (!is_admin() &amp;&amp; $query-&gt;is_main_query() &amp;&amp; $query-&gt;is_search) {

			$post_types = get_post_types(
				array(
					&#039;public&#039; =&gt; true,
					&#039;show_in_nav_menus&#039; =&gt; true,
				),
				&#039;names&#039;
			);
			$array_include = array();
			foreach ($post_types as $key =&gt; $val) {
				$array_include[] = $key;
			}
			$exclude = array(
				&#039;web-story&#039;,
				&#039;e-landing-page&#039;,
				&#039;penci-block&#039;,
				&#039;penci_builder&#039;,
				&#039;archive-template&#039;,
				&#039;custom-post-template&#039;,
			);

			if (!get_theme_mod(&#039;penci_include_search_page&#039;)) {
				$exclude[] = &#039;page&#039;;
			}

			$array_include = array_diff($array_include, $exclude);
			$query-&gt;set(&#039;post_type&#039;, $array_include);
		}
	}
}

if (!function_exists(&#039;penci_get_default_thumbnail_url&#039;)) {
	function penci_get_default_thumbnail_url() {
		$image_holder = PENCI_SOLEDAD_URL . &#039;/images/no-image.jpg&#039;;
		$user_upload = get_theme_mod( &#039;penci_default_thumbnail&#039; );
		if ( $user_upload ) {
			$image_holder = $user_upload;
		}
		return esc_url($image_holder);
	}
}

if (!function_exists(&#039;penci_get_attachment_id_from_url&#039;)) {
	function penci_get_attachment_id_from_url($url) {
		// Get the attachment ID from the URL
		global $wpdb;

		// Remove the site URL from the file path
		$upload_dir_paths = wp_upload_dir();
		$url = str_replace($upload_dir_paths[&#039;baseurl&#039;] . &#039;/&#039;, &#039;&#039;, $url);

		// Query the attachment ID from the database
		$attachment_id = $wpdb-&gt;get_var($wpdb-&gt;prepare(&quot;
			SELECT ID FROM $wpdb-&gt;posts
			WHERE guid RLIKE %s
			AND post_type = &#039;attachment&#039;
		&quot;, $url));

		return $attachment_id;
	}
}

add_filter( &#039;post_thumbnail_id&#039;, function ( $thumbnail_id, $post ) {

	if ( ! is_admin() &amp;&amp; ! $thumbnail_id ) {
		$user_upload = get_theme_mod( &#039;penci_default_thumbnail&#039; );
		$thumbnail_id = $user_upload ? penci_get_attachment_id_from_url( $user_upload ) : &#039;&#039;;
	}

	return $thumbnail_id;
}, 10, 2 );

/**
 * Get the featured image size url from post
 *
 * @since 3.1
 * @developed PenciDesign
 */
if (!function_exists(&#039;penci_get_featured_image_size&#039;)) {
	function penci_get_featured_image_size($id, $size = &#039;full&#039;) {
		if (!has_post_thumbnail($id)) {
			return penci_get_default_thumbnail_url();
		} else {
			$image_html = get_the_post_thumbnail($id, $size);
			preg_match(&#039;@src=&quot;([^&quot;]+)&quot;@&#039;, $image_html, $match);
			$src = array_pop($match);
			$src_check = $src &amp;&amp; $src !== &#039;null&#039; ? substr($src, -4) : &#039;&#039;;

			if ($src_check == &#039;.gif&#039;) {
				$image_full = get_the_post_thumbnail($id, &#039;full&#039;);
				preg_match(&#039;@src=&quot;([^&quot;]+)&quot;@&#039;, $image_full, $match_full);
				$src = array_pop($match_full);
			}

			return esc_url($src ? $src : &#039;&#039;);
		}
	}
}

if (!function_exists(&#039;penci_get_featured_single_image_size&#039;)) {
	function penci_get_featured_single_image_size($id, $size = &#039;full&#039;, $enable_jarallax = false, $thumb_alt = &#039;&#039;) {
		$ratio = &#039;67&#039;;
		$src = penci_get_default_thumbnail_url();

		if (has_post_thumbnail($id)) {
			$image_html = get_the_post_thumbnail($id, $size);
			preg_match(&#039;@src=&quot;([^&quot;]+)&quot;@&#039;, $image_html, $match);
			$src = array_pop($match);
			$src_check = $src !== &#039;null&#039; ? substr($src, -4) : &#039;&#039;;

			if ($src_check == &#039;.gif&#039;) {
				$image_full = get_the_post_thumbnail($id, &#039;full&#039;);
				$image_html = get_the_post_thumbnail($id, &#039;full&#039;);
				preg_match(&#039;@src=&quot;([^&quot;]+)&quot;@&#039;, $image_full, $match_full);
				$src = array_pop($match_full);
			}

			if (preg_match_all(&#039;#(width|height)=(\&#039;|&quot;)?(?&lt;dimensions&gt;[0-9]+)(\&#039;|&quot;)?#i&#039;, $image_html, $image_dis) &amp;&amp; 2 == count((array) $image_dis[&#039;dimensions&#039;])) {
				$width = isset($image_dis[&#039;dimensions&#039;][0]) ? $image_dis[&#039;dimensions&#039;][0] : 0;
				$height = isset($image_dis[&#039;dimensions&#039;][1]) ? $image_dis[&#039;dimensions&#039;][1] : 0;

				if ($width &amp;&amp; $height) {
					$ratio = number_format($height / $width * 100, 4);
				}
			}
		}

		$class = &#039;attachment-penci-full-thumb size-penci-full-thumb penci-single-featured-img wp-post-image&#039;;
		$style_ratio = &#039;padding-top: &#039; . $ratio . &#039;%;&#039;;

		if ($enable_jarallax) {
			$image_html = &#039;&lt;img class=&quot;jarallax-img&quot; src=&quot;&#039; . $src . &#039;&quot; alt=&quot;&#039; . $thumb_alt . &#039;&quot;&gt;&#039;;
		} elseif (!get_theme_mod(&#039;penci_speed_disable_first_screen&#039;) || get_theme_mod(&#039;penci_disable_lazyload_fsingle&#039;)) {
			$image_html = &#039;&lt;span class=&quot;&#039; . $class . &#039; penci-disable-lazy&quot; style=&quot;background-image: url(&#039; . $src . &#039;);&#039; . $style_ratio . &#039;&quot;&gt;&lt;/span&gt;&#039;;
		} else {
			$src = penci_image_srcset($id, $size, &#039;penci-masonry-thumb&#039;);
			$image_html = &#039;&lt;span class=&quot;&#039; . $class . &#039; penci-lazy&quot; data-bgset=&quot;&#039; . $src . &#039;&quot; style=&quot;&#039; . $style_ratio . &#039;&quot;&gt;&lt;/span&gt;&#039;;
		}

		return $image_html;
	}
}

/*
 * Get featured image ratio based on the post ID &amp; thumbnail size.
 */

if (!function_exists(&#039;penci_get_featured_image_padding_markup&#039;)) {
	function penci_get_featured_image_padding_markup($postid, $image_thumb = &#039;full&#039;, $return_ratio = null) {
		$ratio = &#039;66.6666667&#039;;

		if (has_post_thumbnail($postid)) {
			$image = get_the_post_thumbnail($postid, $image_thumb);
		} else {
			$image = &#039;&lt;img src=&quot;&#039; . penci_get_default_thumbnail_url() . &#039;&quot; alt=&quot;&#039; . __(&#039;No Thumbnail&#039;, &#039;pencidesign&#039;) . &#039;&quot; /&gt;&#039;;
		}

		if (preg_match_all(&#039;#(width|height)=(\&#039;|&quot;)?(?&lt;dimensions&gt;[0-9]+)(\&#039;|&quot;)?#i&#039;, $image, $image_dis) &amp;&amp; 2 == count((array) $image_dis[&#039;dimensions&#039;])) {
			$ratio = number_format(($image_dis[&#039;dimensions&#039;][1] / $image_dis[&#039;dimensions&#039;][0]) * 100, 8);
		}

		$output = &#039;&lt;span class=&quot;penci-isotope-padding&quot; style=&quot;padding-bottom:&#039; . $ratio . &#039;%;&quot;&gt;&lt;/span&gt;&#039;;

		if ($return_ratio) {
			$output = $ratio;
		}

		return $output;
	}
}

/* Get ratio markup for post format gallery */
if (!function_exists(&#039;penci_get_ratio_img_format_gallery&#039;)) {
	function penci_get_ratio_img_format_gallery($image) {
		$ratio = &#039;66.6666667&#039;;
		/* $image = wp_get_attachment_image_src( $image_id, $thumbnail_size ); */

		if (!empty($image)) {
			$img_width = isset($image[1]) ? $image[1] : &#039;&#039;;
			$img_height = isset($image[2]) ? $image[2] : &#039;&#039;;
			if ($img_width &amp;&amp; $img_height) {
				$ratio = number_format(($img_height / $img_width) * 100, 8);
			}
		}

		$output = &#039;&lt;span class=&quot;penci-isotope-padding&quot; style=&quot;padding-bottom:&#039; . $ratio . &#039;%;&quot;&gt;&lt;/span&gt;&#039;;

		return $output;
	}
}

if (!function_exists(&#039;penci_get_list_image_sizes&#039;)) {
	function penci_get_list_image_sizes($default = false) {
		$wp_image_sizes = penci_get_all_image_sizes();

		$image_sizes = array();

		if ($default) {
			$image_sizes[esc_html__(&#039;Default&#039;, &#039;soledad&#039;)] = &#039;&#039;;
		}

		foreach ($wp_image_sizes as $size_key =&gt; $size_attributes) {
			$control_title = ucwords(str_replace(&#039;_&#039;, &#039; &#039;, $size_key));
			if (is_array($size_attributes)) {
				$control_title .= sprintf(&#039; - %d x %d&#039;, $size_attributes[&#039;width&#039;], $size_attributes[&#039;height&#039;]);
			}

			$image_sizes[$control_title] = $size_key;
		}

		$image_sizes[_x(&#039;Full&#039;, &#039;Image Size Control&#039;, &#039;soledad&#039;)] = &#039;full&#039;;

		return $image_sizes;
	}
}
if (!function_exists(&#039;penci_get_all_image_sizes&#039;)) {
	function penci_get_all_image_sizes() {
		global $_wp_additional_image_sizes;

		$default_image_sizes = array(&#039;thumbnail&#039;, &#039;medium&#039;, &#039;medium_large&#039;, &#039;large&#039;);

		$image_sizes = array();

		foreach ($default_image_sizes as $size) {
			$image_sizes[$size] = array(
				&#039;width&#039; =&gt; (int) get_option($size . &#039;_size_w&#039;),
				&#039;height&#039; =&gt; (int) get_option($size . &#039;_size_h&#039;),
				&#039;crop&#039; =&gt; (bool) get_option($size . &#039;_crop&#039;),
			);
		}

		if ($_wp_additional_image_sizes) {
			$image_sizes = array_merge($image_sizes, $_wp_additional_image_sizes);
		}

		return $image_sizes;
	}
}

/**
 * Get image ratio based on image size
 *
 * @since 6.3
 * @developed PenciDesign
 */
if (!function_exists(&#039;penci_get_featured_image_ratio&#039;)) {
	function penci_get_featured_image_ratio($id, $size = &#039;full&#039;) {
		$ratio = &#039;66.6667&#039;;

		if (has_post_thumbnail($id)) {
			$image_html = get_the_post_thumbnail($id, $size);
			preg_match(&#039;@src=&quot;([^&quot;]+)&quot;@&#039;, $image_html, $match);
			$src = array_pop($match);
			$src_check = $src !== null ? substr($src, -4) : &#039;&#039;;

			if ($src_check == &#039;.gif&#039;) {
				$image_html = get_the_post_thumbnail($id, &#039;full&#039;);
			}

			if (preg_match_all(&#039;#(width|height)=(\&#039;|&quot;)?(?&lt;dimensions&gt;[0-9]+)(\&#039;|&quot;)?#i&#039;, $image_html, $image_dis) &amp;&amp; 2 == count((array) $image_dis[&#039;dimensions&#039;])) {
				$width = isset($image_dis[&#039;dimensions&#039;][0]) ? $image_dis[&#039;dimensions&#039;][0] : 0;
				$height = isset($image_dis[&#039;dimensions&#039;][1]) ? $image_dis[&#039;dimensions&#039;][1] : 0;

				if ($width &amp;&amp; $height) {
					$ratio = number_format($height / $width * 100, 4);
				}
			}
		}

		return $ratio;
	}
}

/**
 * Convert image URL to image path
 *
 * @since 8.2.1
 * @developed PenciDesign
 */
if (!function_exists(&#039;penci_get_image_path&#039;)) {
	function penci_get_image_path($image_url) {
		$file = &#039;&#039;;
		$parsed_url = parse_url($image_url);
		if (!empty($parsed_url[&#039;path&#039;])) {
			$file = ABSPATH . ltrim($parsed_url[&#039;path&#039;], &#039;/&#039;);
		}
		return $file &amp;&amp; stream_resolve_include_path($file) ? $file : &#039;&#039;;
	}
}

/**
 * Get the featured image size url based on featured image full url
 *
 * @since 3.1
 * @developed PenciDesign
 */
if (!function_exists(&#039;penci_get_image_size_url&#039;)) {
	function penci_get_image_size_url($image_url, $size = &#039;full&#039;) {
		$image_thumb_html = $image_url;

		$imgsizes = penci_get_all_image_sizes();
		if (isset($imgsizes[$size])) {

			$filetype = wp_check_filetype($image_url);
			$filetype_ext = isset($filetype[&#039;ext&#039;]) ? $filetype[&#039;ext&#039;] : &#039;&#039;;
			if ($filetype_ext &amp;&amp; $filetype_ext != &#039;gif&#039;) {

				$width = $imgsizes[$size][&#039;width&#039;];
				$height = $imgsizes[$size][&#039;height&#039;];
				$crop = $imgsizes[$size][&#039;crop&#039;];

				$original_width = &#039;&#039;;
				$original_height = &#039;&#039;;
				$original_check = penci_get_image_path($image_url);

				if ($original_check) {
					list($original_width, $original_height) = getimagesize($original_check);
				}

				if ((!$height || $height == 99999 || $height &gt; $original_height) &amp;&amp; $original_width &gt; $width &amp;&amp; !$crop) {
					$height = round($width * ($original_height / $original_width));
				} elseif ($crop &amp; $height &gt; $original_height) {
					$height = $original_height;
				}

				$width = min($width, $original_width);

				$imgcheck = str_replace(&#039;.&#039; . $filetype_ext, &#039;-&#039; . $width . &#039;x&#039; . $height . &#039;.&#039; . $filetype_ext, $image_thumb_html);

				if (penci_get_image_path($imgcheck)) {
					$image_thumb_html = $imgcheck;
				}
			}
		}

		return $image_thumb_html;
	}
}

/**
 * Get image ratio based on the image URL
 *
 * @since 7.9
 * @developed PenciDesign
 */
if (!function_exists(&#039;penci_get_ratio_size_based_url&#039;)) {
	function penci_get_ratio_size_based_url($image_url) {
		$return = &#039;66.66667&#039;;

		$cache_key = &#039;pc_idata_&#039; . md5($image_url);

		$data = get_transient($cache_key);
		if ($data &amp;&amp; is_array($data)) {
			$return = number_format(($data[&#039;w&#039;] / $data[&#039;h&#039;]) * 100, 5);
		}
		$image_path = penci_get_image_path($image_url);
		if ($image_path) {
			list($width, $height) = getimagesize($image_path);
			if ($width &amp;&amp; $height) {
				$return = number_format(($width / $height) * 100, 5);
				set_transient(
					$cache_key,
					array(
						&#039;w&#039; =&gt; $width,
						&#039;h&#039; =&gt; $height,
					),
					604800
				);
			}
		}

		return $return;
	}
}

/**
 * Get the image width/height based on the image URL
 *
 * @since 3.1
 * @developed PenciDesign
 */
if (!function_exists(&#039;penci_get_image_data_basedurl&#039;)) {
	function penci_get_image_data_basedurl($image_url, $data = &#039;w&#039;) {
		$return = $width = $height = &#039;&#039;;
		$cache_key = &#039;pc_idata_&#039; . md5($image_url);
		$data_cache = get_transient($cache_key);
		$penci_image_path = penci_get_image_path($image_url);
		if ($data_cache) {
			$width = $data_cache[&#039;w&#039;];
			$height = $data_cache[&#039;h&#039;];
		} elseif ($penci_image_path) {
			list($width, $height) = getimagesize($penci_image_path);
			if ($width &amp;&amp; $height) {
				set_transient(
					$cache_key,
					array(
						&#039;w&#039; =&gt; $width,
						&#039;h&#039; =&gt; $height,
					),
					604800
				);
			}
		}
		if ($data == &#039;w&#039; &amp;&amp; $width) {
			$return = $width;
		} elseif ($data == &#039;h&#039; &amp;&amp; $height) {
			$return = $height;
		} elseif ($data == &#039;url&#039;) {
			$return = $image_url;
		}

		return $return;
	}
}

/**
 * Get the featured image width/height based on the post ID
 *
 * @since 8.0
 */
if (!function_exists(&#039;penci_get_image_data_based_post_id&#039;)) {
	function penci_get_image_data_based_post_id($postid, $image_thumb, $data = &#039;w&#039;, $echo = true) {
		$return = &#039;&#039;;
		if (has_post_thumbnail($postid)) {
			$image = get_the_post_thumbnail($postid, $image_thumb);
			if (preg_match_all(&#039;#(width|height)=(\&#039;|&quot;)?(?&lt;dimensions&gt;[0-9]+)(\&#039;|&quot;)?#i&#039;, $image, $image_dis) &amp;&amp; 2 == count((array) $image_dis[&#039;dimensions&#039;])) {
				$height = $image_dis[&#039;dimensions&#039;][1];
				$width = $image_dis[&#039;dimensions&#039;][0];
				if (&#039;h&#039; == $data) {
					$return = $height;
				} elseif (&#039;w&#039; == $data) {
					$return = $width;
				}
			}
		}

		if (!$echo) {
			return $return;
		} else {
			echo $return;
		}
	}
}

/**
 * Get the featured image type display on the layouts
 *
 * @since 5.3
 * @developed PenciDesign
 */
if (!function_exists(&#039;penci_featured_images_size&#039;)) {
	function penci_featured_images_size($size = &#039;normal&#039;) {

		$return_size = &#039;penci-thumb&#039;;
		if (&#039;small&#039; == $size) {
			$return_size = &#039;penci-thumb-small&#039;;
		} elseif (&#039;large&#039; == $size) {
			$return_size = &#039;penci-magazine-slider&#039;;
		} elseif ( &#039;masonry&#039; == $size ) {
			$return_size = &#039;penci-masonry-thumb&#039;;
		}

		$customize_data = get_theme_mod(&#039;penci_featured_image_size&#039;);
		if (&#039;square&#039; == $customize_data) {
			$return_size = &#039;penci-thumb-square&#039;;
			if (&#039;large&#039; == $size) {
				$return_size = &#039;penci-full-thumb&#039;;
			}
		} elseif (&#039;vertical&#039; == $customize_data) {
			$return_size = &#039;penci-thumb-vertical&#039;;
			if (&#039;large&#039; == $size) {
				$return_size = &#039;penci-full-thumb&#039;;
			}
		}

		return $return_size;
	}
}

/**
 * Get the featured image type display on the layouts
 *
 * @since 5.3
 * @developed PenciDesign
 */
if (!function_exists(&#039;penci_featured_images_size_vcel&#039;)) {
	function penci_featured_images_size_vcel($size = &#039;normal&#039;, $image_size = &#039;&#039;, $custom_size = null) {

		$return_size = &#039;penci-thumb&#039;;
		if (&#039;small&#039; == $size) {
			$return_size = &#039;penci-thumb-small&#039;;
		} elseif (&#039;large&#039; == $size) {
			$return_size = &#039;penci-magazine-slider&#039;;
		}

		$customize_data = get_theme_mod(&#039;penci_featured_image_size&#039;);
		if ($image_size) {
			$customize_data = $image_size;
		}

		if (&#039;horizontal&#039; == $customize_data) {
			$return_size = &#039;penci-thumb&#039;;
			if (&#039;small&#039; == $size) {
				$return_size = &#039;penci-thumb-small&#039;;
			} elseif (&#039;large&#039; == $size) {
				$return_size = &#039;penci-magazine-slider&#039;;
			}
		} elseif (&#039;square&#039; == $customize_data) {
			$return_size = &#039;penci-thumb-square&#039;;
			if (&#039;large&#039; == $size) {
				$return_size = &#039;penci-full-thumb&#039;;
			}
		} elseif (&#039;vertical&#039; == $customize_data) {
			$return_size = &#039;penci-thumb-vertical&#039;;
			if (&#039;large&#039; == $size) {
				$return_size = &#039;penci-full-thumb&#039;;
			}
		} elseif (&#039;custom&#039; == $customize_data) {
			if ($custom_size) {
				$return_size = $custom_size;
			}
		}

		return $return_size;
	}
}

/**
 * Get the author posts link
 *
 * @since 8.0
 * @developed PenciDesign
 */
if (!function_exists(&#039;penci_get_the_author_posts_link&#039;)) {
	function penci_get_the_author_posts_link($author_id = null) {

		global $authordata;
		
		if ($author_id) {
			$authorID = $author_id;
			$authorNicename = get_the_author_meta(&#039;user_nicename&#039;, $authorID);
			$authorDisplay = get_the_author_meta(&#039;display_name&#039;, $authorID);
		} elseif (is_object($authordata)) {
			$authorID = $authordata-&gt;ID;
			$authorNicename = $authordata-&gt;user_nicename;
			$authorDisplay = get_the_author();
		} elseif (!is_object($authordata)) {
			return &#039;&#039;;
		}

		$authorLink = esc_url(get_author_posts_url($authorID, $authorNicename));
		

		if (!$authorDisplay &amp;&amp; function_exists(&#039;get_the_coauthor_meta&#039;)) {
			$authorDisplay = get_the_coauthor_meta(&#039;display_name&#039;, $author_id);
			$authorDisplay = $authorDisplay[$author_id];

			$authorLink = get_the_coauthor_meta(&#039;url&#039;, $author_id);
			$authorLink = isset($authorLink[$author_id]) &amp;&amp; $authorLink[$author_id] ? $authorLink[$author_id] : &#039;&#039;;

		}

		$link = sprintf(
			&#039;&lt;a href=&quot;%1$s&quot; title=&quot;%2$s&quot; rel=&quot;author&quot;&gt;%3$s&lt;/a&gt;&#039;,
			$authorLink,
			/* translators: %s: Author&#039;s display name. */
			esc_attr(penci_get_setting(&#039;penci_trans_author&#039;) . &#039; &#039; . $authorDisplay),
			$authorDisplay
		);

		return apply_filters(&#039;the_author_posts_link&#039;, $link);
	}
}

/**
 * Get the featured image type display on category mega menu items
 *
 * @since 5.3
 * @developed PenciDesign
 */
if (!function_exists(&#039;penci_megamenu_featured_images_size&#039;)) {
	function penci_megamenu_featured_images_size() {

		$return_size = &#039;penci-thumb&#039;;

		$customize_data = get_theme_mod(&#039;penci_mega_featured_image_size&#039;);
		if (&#039;square&#039; == $customize_data) {
			$return_size = &#039;penci-thumb-square&#039;;
		} elseif (&#039;vertical&#039; == $customize_data) {
			$return_size = &#039;penci-thumb-vertical&#039;;
		}

		return $return_size;
	}
}

/**
 * Setup functions to count viewed posts to create popular posts
 *
 * @param string $postID - post ID of this post
 *
 * @return numbers viewed posts
 * @since 1.0
 */
if (!function_exists(&#039;penci_get_postviews_key&#039;)) {
	function penci_get_postviews_key() {
		$count_key = &#039;penci_post_views_count&#039;;
		if ((&#039;custom&#039; == get_theme_mod(&#039;penci_general_views_meta&#039;)) &amp;&amp; get_theme_mod(&#039;penci_general_views_key&#039;)) {
			$count_key = get_theme_mod(&#039;penci_general_views_key&#039;);
		}

		return apply_filters(&#039;penci_get_postviews_key&#039;, $count_key);
	}
}

/**
 * Setup functions to count viewed posts to create popular posts
 *
 * @param string $postID - post ID of this post
 *
 * @return numbers viewed posts
 * @since 1.0
 */
if ( ! function_exists( &#039;penci_get_post_views&#039; ) ) {
	function penci_get_post_views( $postID ) {
		$count_key = penci_get_postviews_key();
		$count     = get_post_meta( $postID, $count_key, true );

		if ( &#039;&#039; === $count ) {
			delete_post_meta( $postID, $count_key );
			add_post_meta( $postID, $count_key, &#039;0&#039; );
			$count = 0;
		}

		$count = absint( $count );

		if ( $count &gt;= 1000000 ) {
			$value  = penci_trim_post_views_decimal( number_format_i18n( $count / 1000000, 1 ) );
			$return = $value . penci_get_setting( &#039;penci_trans_m_number&#039; );
		} elseif ( $count &gt;= 1000 ) {
			$value  = penci_trim_post_views_decimal( number_format_i18n( $count / 1000, 1 ) );
			$return = $value . penci_get_setting( &#039;penci_trans_k_number&#039; );
		} else {
			$return = number_format_i18n( $count );
		}

		$return = apply_filters( &#039;penci_filter_post_views_number&#039;, $return );

		return apply_filters( &#039;penci_get_post_views&#039;, $return );
	}
}

if ( ! function_exists( &#039;penci_trim_post_views_decimal&#039; ) ) {
	function penci_trim_post_views_decimal( $number ) {
		$decimal_point = isset( $GLOBALS[&#039;wp_locale&#039;] )
			? $GLOBALS[&#039;wp_locale&#039;]-&gt;number_format[&#039;decimal_point&#039;]
			: &#039;.&#039;;

		// Trim trailing zero decimal for both 1.0 and 1,0.
		$number = preg_replace(
			&#039;/(&#039; . preg_quote( $decimal_point, &#039;/&#039; ) . &#039;)0$/&#039;,
			&#039;&#039;,
			$number
		);

		return $number;
	}
}

if (!function_exists(&#039;penci_set_post_views&#039;)) {
	function penci_set_post_views($postID) {
		if (get_theme_mod(&#039;penci_enable_ajax_view&#039;)) {
			add_action(&#039;wp_footer&#039;, &#039;penci_cview_ajax_footer_script&#039;, 999);
			return;
		}

		$count_key = penci_get_postviews_key();
		$count_dkey = &#039;penci_post_day_views_count&#039;;
		$count_wkey = &#039;penci_post_week_views_count&#039;;
		$count_mkey = &#039;penci_post_month_views_count&#039;;
		$count = get_post_meta($postID, $count_key, true);
		$count_d = get_post_meta($postID, $count_dkey, true);
		$count_w = get_post_meta($postID, $count_wkey, true);
		$count_m = get_post_meta($postID, $count_mkey, true);

		/* Update views count all time */
		if ($count == &#039;&#039;) {
			$count = 0;
			delete_post_meta($postID, $count_key);
			add_post_meta($postID, $count_key, $count);
		} else {
			++$count;
			update_post_meta($postID, $count_key, $count);
		}

		/* Update views count week */
		if ($count_d == &#039;&#039;) {
			$count_d = 0;
			delete_post_meta($postID, $count_dkey);
			add_post_meta($postID, $count_dkey, $count_d);
		} else {
			++$count_d;
			update_post_meta($postID, $count_dkey, $count_d);
		}

		/* Update views count week */
		if ($count_w == &#039;&#039;) {
			$count_w = 0;
			delete_post_meta($postID, $count_wkey);
			add_post_meta($postID, $count_wkey, $count_w);
		} else {
			++$count_w;
			update_post_meta($postID, $count_wkey, $count_w);
		}

		/* Update views count month */
		if ($count_m == &#039;&#039;) {
			$count_m = 0;
			delete_post_meta($postID, $count_mkey);
			add_post_meta($postID, $count_mkey, $count_m);
		} else {
			++$count_m;
			update_post_meta($postID, $count_mkey, $count_m);
		}
	}
}

if (!function_exists(&#039;penci_cview_ajax_footer_script&#039;)):
	function penci_cview_ajax_footer_script() {
		?&gt;
				&lt;script type=&quot;text/javascript&quot;&gt;
					function PenciSimplePopularPosts_AddCount(id, endpoint)
					{
						var xmlhttp
						var params = &#039;/?penci_spp_count=1&amp;penci_spp_post_id=&#039; + id + &#039;&amp;cachebuster=&#039; +  Math.floor((Math.random() * 100000))
						// code for IE7+, Firefox, Chrome, Opera, Safari

						if (window.XMLHttpRequest){
							xmlhttp=new XMLHttpRequest()
						}else{
							xmlhttp=new ActiveXObject(&#039;Microsoft.XMLHTTP&#039;)
						}

						xmlhttp.onreadystatechange=function(){
							if ( xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200 &amp;&amp; document.getElementsByClassName( &#039;penci-post-countview-number&#039; ).length &gt; 0 ) {
								var data = JSON.parse( xmlhttp.responseText )
								document.getElementsByClassName( &#039;penci-post-countview-number&#039; )[0].innerHTML = data.visits
							}
						}

						xmlhttp.open(&#039;GET&#039;, endpoint + params, true)
						xmlhttp.send()
					}
					PenciSimplePopularPosts_AddCount(&lt;?php echo get_the_ID(); ?&gt;, &#039;&lt;?php echo get_site_url(); ?&gt;&#039;)
				&lt;/script&gt;
						&lt;?php
	}
endif;
if (!function_exists(&#039;penci_cview_ajax_query_vars&#039;)):
	function penci_cview_ajax_query_vars($query_vars) {
		if (get_theme_mod(&#039;penci_enable_ajax_view&#039;)) {
			$query_vars[] = &#039;penci_spp_count&#039;;
			$query_vars[] = &#039;penci_spp_post_id&#039;;
		}

		return $query_vars;
	}
	add_filter(&#039;query_vars&#039;, &#039;penci_cview_ajax_query_vars&#039;);
endif;

if (!function_exists(&#039;penci_cview_ajax_count&#039;)):
	function penci_cview_ajax_count() {
		/**
		 * Endpoint for counting visits
		 */
		if (intval(get_query_var(&#039;penci_spp_count&#039;)) === 1 &amp;&amp; intval(get_query_var(&#039;penci_spp_post_id&#039;)) !== 0) {
			// JSON response
			header(&#039;Content-Type: application/json&#039;);
			$postID = intval(get_query_var(&#039;penci_spp_post_id&#039;));
			$count_key = penci_get_postviews_key();
			$count_dkey = &#039;penci_post_day_views_count&#039;;
			$count_wkey = &#039;penci_post_week_views_count&#039;;
			$count_mkey = &#039;penci_post_month_views_count&#039;;
			$count 	 = get_post_meta($postID, $count_key, true);
			$count_d = get_post_meta($postID, $count_dkey, true);
			$count_w = get_post_meta($postID, $count_wkey, true);
			$count_m = get_post_meta($postID, $count_mkey, true);
			$current_count = 0;

			/* Update views count all time */
			if ($count == &#039;&#039;) {
				$count = 0;

				$current_count = $count;
				delete_post_meta($postID, $count_key);
				add_post_meta($postID, $count_key, $count);
			} else {
				++$count;

				$current_count = $count;
				update_post_meta($postID, $count_key, $count);
			}

			/* Update views count day */
			if ($count_d == &#039;&#039;) {
				$count_d = 0;
				delete_post_meta($postID, $count_dkey);
				add_post_meta($postID, $count_dkey, $count_d);
			} else {
				++$count_d;
				update_post_meta($postID, $count_dkey, $count_d);
			}

			/* Update views count week */
			if ($count_w == &#039;&#039;) {
				$count_w = 0;
				delete_post_meta($postID, $count_wkey);
				add_post_meta($postID, $count_wkey, $count_w);
			} else {
				++$count_w;
				update_post_meta($postID, $count_wkey, $count_w);
			}

			/* Update views count month */
			if ($count_m == &#039;&#039;) {
				$count_m = 0;
				delete_post_meta($postID, $count_mkey);
				add_post_meta($postID, $count_mkey, $count_m);
			} else {
				++$count_m;
				update_post_meta($postID, $count_mkey, $count_m);
			}

			echo json_encode(
				array(
					&#039;status&#039; =&gt; &#039;OK&#039;,
					&#039;visits&#039; =&gt; intval($current_count),
				)
			);
			die();
		}
	}
	add_action(&#039;wp&#039;, &#039;penci_cview_ajax_count&#039;);
endif;

/**
 * Add schedules intervals
 *
 * @param  array $schedules
 *
 * @return array
 *@since  2.5.1
 */
add_filter(&#039;cron_schedules&#039;, &#039;penci_add_schedules_intervals&#039;);
if (!function_exists(&#039;penci_add_schedules_intervals&#039;)) {
	function penci_add_schedules_intervals($schedules) {

		$schedules[&#039;daily&#039;] = array(
			&#039;interval&#039; =&gt; 86400,
			&#039;display&#039; =&gt; __(&#039;Daily&#039;, &#039;soledad&#039;),
		);

		$schedules[&#039;weekly&#039;] = array(
			&#039;interval&#039; =&gt; 604800,
			&#039;display&#039; =&gt; __(&#039;Weekly&#039;, &#039;soledad&#039;),
		);

		$schedules[&#039;monthly&#039;] = array(
			&#039;interval&#039; =&gt; 2635200,
			&#039;display&#039; =&gt; __(&#039;Monthly&#039;, &#039;soledad&#039;),
		);

		return $schedules;
	}
}

/**
 * Add scheduled event during theme activation
 *
 * @return void
 *@since  2.5.1
 */
add_action(&#039;after_switch_theme&#039;, &#039;penci_add_schedule_events&#039;);
if (!function_exists(&#039;penci_add_schedule_events&#039;)) {
	function penci_add_schedule_events() {

		if (!wp_next_scheduled(&#039;penci_reset_track_data_daily&#039;)) {
			wp_schedule_event(time(), &#039;daily&#039;, &#039;penci_reset_track_data_daily&#039;);}

		if (!wp_next_scheduled(&#039;penci_reset_track_data_weekly&#039;)) {
			wp_schedule_event(time(), &#039;weekly&#039;, &#039;penci_reset_track_data_weekly&#039;);}

		if (!wp_next_scheduled(&#039;penci_reset_track_data_monthly&#039;)) {
			wp_schedule_event(time(), &#039;monthly&#039;, &#039;penci_reset_track_data_monthly&#039;);}
	}
}

/**
 * Remove scheduled events when theme deactived
 *
 * @return void
 *@since  2.5.1
 */
add_action(&#039;switch_theme&#039;, &#039;penci_remove_schedule_events&#039;);
if (!function_exists(&#039;penci_remove_schedule_events&#039;)) {
	function penci_remove_schedule_events() {
		wp_clear_scheduled_hook(&#039;penci_reset_track_data_daily&#039;);
		wp_clear_scheduled_hook(&#039;penci_reset_track_data_weekly&#039;);
		wp_clear_scheduled_hook(&#039;penci_reset_track_data_monthly&#039;);
	}
}

/**
 * Reset view counter of week
 *
 * @return void
 *@since  2.5.1
 */
add_action(&#039;penci_reset_track_data_weekly&#039;, &#039;penci_reset_week_view&#039;);
if (!function_exists(
	&#039;penci_reset_week_view

&#039;
)) {
	function penci_reset_week_view() {
		global $wpdb;

		$meta_key = &#039;penci_post_week_views_count&#039;;
		$wpdb-&gt;query($wpdb-&gt;prepare(&quot;UPDATE $wpdb-&gt;postmeta SET meta_value = &#039;0&#039; WHERE meta_key = %s&quot;, $meta_key));
	}
}

/**
 * Reset view counter of month
 *
 * @return void
 *@since  2.5.1
 */
add_action(&#039;penci_reset_track_data_monthly&#039;, &#039;penci_reset_month_view&#039;);
if (!function_exists(&#039;penci_reset_month_view&#039;)) {
	function penci_reset_month_view() {
		global $wpdb;

		$meta_key = &#039;penci_post_month_views_count&#039;;
		$wpdb-&gt;query($wpdb-&gt;prepare(&quot;UPDATE $wpdb-&gt;postmeta SET meta_value = &#039;0&#039; WHERE meta_key = %s&quot;, $meta_key));
	}
}

/**
 * Reset view counter of day
 *
 * @return void
 *@since  8.4.6
 */
add_action(&#039;penci_reset_track_data_daily&#039;, &#039;penci_reset_daily_view&#039;);
if (!function_exists(&#039;penci_reset_daily_view&#039;)) {
	function penci_reset_daily_view() {
		global $wpdb;

		$meta_key = &#039;penci_post_day_views_count&#039;;
		$wpdb-&gt;query($wpdb-&gt;prepare(&quot;UPDATE $wpdb-&gt;postmeta SET meta_value = &#039;0&#039; WHERE meta_key = %s&quot;, $meta_key));
	}
}


/**
 * Get custom excerpt length from the_content() function
 * Will use this function and call it in penci_add_fb_open_graph_tags() function
 *
 * @return excerpt content from the_content
 *@since 1.1
 */

if (!function_exists(&#039;penci_trim_excerpt_from_content&#039;)) {
	function penci_trim_excerpt_from_content($text, $excerpt) {

		if ($excerpt) {
			return $excerpt;}

		$text = strip_shortcodes($text);

		$text = apply_filters(&#039;the_content&#039;, $text);
		$text = str_replace(&#039;]]&gt;&#039;, &#039;]]&amp;gt;&#039;, $text);
		$text = strip_tags($text);
		$excerpt_length = apply_filters(&#039;excerpt_length&#039;, 55);
		$excerpt_more = apply_filters(&#039;excerpt_more&#039;, &#039; &#039; . &#039;...&#039;);
		$words = preg_split(
			&quot;/[\n
	 ]+/&quot;,
			$text,
			$excerpt_length + 1,
			PREG_SPLIT_NO_EMPTY
		);
		if (count($words) &gt; $excerpt_length) {
			array_pop($words);
			$text = implode(&#039; &#039;, $words);
			$text = $text . $excerpt_more;
		} else {
			$text = implode(&#039; &#039;, $words);
		}

		return apply_filters(&#039;wp_trim_excerpt&#039;, $text, $excerpt);
	}
}

/**
 * Get categories parent list
 *
 * @since 3.2
 */
if (!function_exists(&#039;penci_get_category_parents&#039;)) {
	function penci_get_category_parents($id) {
		$chain = &#039;&#039;;
		$parent = get_term($id, &#039;category&#039;);

		if (is_wp_error($parent)) {
			return &#039;&#039;;}

		$name = $parent-&gt;name;

		if ($parent-&gt;parent &amp;&amp; ($parent-&gt;parent != $parent-&gt;term_id)) {
			$chain .= penci_get_category_parents($parent-&gt;parent);
		}

		$chain .= &#039;&lt;span&gt;&lt;a class=&quot;crumb&quot; href=&quot;&#039; . esc_url(get_category_link($parent-&gt;term_id)) . &#039;&quot;&gt;&#039; . $name . &#039;&lt;/a&gt;&lt;/span&gt;&#039; . penci_icon_by_ver(&#039;fas fa-angle-right&#039;) . &#039;&lt;/i&gt;&#039;;

		return $chain;
	}
}

/**
 * Get category parent of a category
 *
 * @since 3.2
 */
if (!function_exists(&#039;penci_get_category_parent_id&#039;)) {
	function penci_get_category_parent_id($id) {
		$return = &#039;&#039;;
		$parent = get_term($id, &#039;category&#039;);

		if (is_wp_error($parent)) {
			return &#039;&#039;;}

		if ($parent-&gt;parent &amp;&amp; $parent-&gt;parent != $parent-&gt;term_id) {
			$return = $parent-&gt;parent;
		}

		return $return;
	}
}

/**
 * Return google adsense markup
 *
 * @since 3.2
 */
if (!function_exists(&#039;penci_render_google_adsense&#039;)) {
	function penci_render_google_adsense($option) {
		if (!get_theme_mod($option)) {
			return &#039;&#039;;}

		return &#039;&lt;div class=&quot;penci-google-adsense &#039; . $option . &#039;&quot;&gt;&#039; . penci_safe_shortcode(get_theme_mod($option)) . &#039;&lt;/div&gt;&#039;;
	}
}

/**
 * Add Next Page/Page Break Button to WordPress Visual Editor
 *
 * @since 4.0.3
 */
if (!function_exists(&#039;penci_add_next_page_button_to_editor&#039;)) {
	add_filter(&#039;mce_buttons&#039;, &#039;penci_add_next_page_button_to_editor&#039;, 1, 2);
	function penci_add_next_page_button_to_editor($buttons, $id) {

		/* only add this for content editor */
		if (&#039;content&#039; != $id) {
			return $buttons;}

		/* add next page after more tag button */
		array_splice($buttons, 13, 0, &#039;wp_page&#039;);

		return $buttons;
	}
}

/**
 * Exclude specific categories from latest posts on Homepage
 *
 * @since 2.4
 */
if (!function_exists(&#039;penci_exclude_specific_categories_display_on_home&#039;)) {
	function penci_exclude_specific_categories_display_on_home($query) {
		if (get_theme_mod(&#039;penci_home_exclude_cat&#039;)) {

			$exclude_cat = get_theme_mod(&#039;penci_home_exclude_cat&#039;);
			$exclude_cats = str_replace(&#039; &#039;, &#039;&#039;, $exclude_cat);
			$exclude_array = explode(&#039;,&#039;, $exclude_cats);

			if ($query-&gt;is_home() &amp;&amp; $query-&gt;is_main_query()) {
				$query-&gt;set(
					&#039;tax_query&#039;,
					array(
						array(
							&#039;taxonomy&#039; =&gt; &#039;category&#039;,
							&#039;field&#039; =&gt; &#039;slug&#039;,
							&#039;terms&#039; =&gt; $exclude_array,
							&#039;operator&#039; =&gt; &#039;NOT IN&#039;,
						),
					)
				);
			}
		}
	}

	add_action(&#039;pre_get_posts&#039;, &#039;penci_exclude_specific_categories_display_on_home&#039;);
}

/**
 * Anbles shortcodes in WordPress widget text
 *
 * @since 1.2.3
 */
add_filter(&#039;widget_text&#039;, &#039;do_shortcode&#039;);

/**
 * Get image alt by image ID
 * If the alt is null - return posts ID
 *
 * @since 5.2
 */
if (!function_exists(&#039;penci_get_image_alt&#039;)) {
	function penci_get_image_alt($thumb_id, $postID = null) {
		$thumb_alt = &#039;&#039;;
		$thumb_alt = get_post_meta($thumb_id, &#039;_wp_attachment_image_alt&#039;, true);

		if ($thumb_alt) {
			$thumb_alt = $thumb_alt;
		}

		return esc_attr($thumb_alt);
	}
}

/**
 * Check if post format + data of post format is available
 *
 * @return boolean or data of post format
 */
if (!function_exists(&#039;penci_get_post_format&#039;)) {
	function penci_get_post_format($format, $getdata = null) {
		$return = false;
		$post_id = get_the_ID();
		$data = &#039;&#039;;
		if (has_post_format(&#039;link&#039;) &amp;&amp; ($format == &#039;link&#039;)) {
			$data = get_post_meta($post_id, &#039;_format_link_url&#039;, true);
		} elseif (has_post_format(&#039;quote&#039;) &amp;&amp; ($format == &#039;quote&#039;)) {
			$data = get_post_meta($post_id, &#039;_format_quote_source_name&#039;, true);
		} elseif (has_post_format(&#039;gallery&#039;) &amp;&amp; ($format == &#039;gallery&#039;)) {
			$data = get_post_meta($post_id, &#039;_format_gallery_images&#039;, true);
		} elseif (has_post_format(&#039;video&#039;) &amp;&amp; ($format == &#039;video&#039;)) {
			$data = get_post_meta($post_id, &#039;_format_video_embed&#039;, true);
		} elseif (has_post_format(&#039;audio&#039;) &amp;&amp; ($format == &#039;audio&#039;)) {
			$data = get_post_meta($post_id, &#039;_format_audio_embed&#039;, true);
		}

		if ($data) {
			$return = true;
		}

		if (&#039;data&#039; == $getdata &amp;&amp; $data) {
			return $data;
		}

		return $return;
	}
}

/**
 * Get image title by image ID
 *
 * @since 5.2
 */
if (!function_exists(&#039;penci_get_image_title&#039;)) {
	function penci_get_image_title($thumb_id) {
		if (get_theme_mod(&#039;penci_disable_image_titles_galleries&#039;)) {
			return &#039;&#039;;
		}

		$thumb_title = $thumb_title_html = &#039;&#039;;
		$thumb_title = get_the_title($thumb_id);

		if ($thumb_title) {
			$thumb_title_html = &#039; title=&quot;&#039; . esc_attr($thumb_title) . &#039;&quot;&#039;;
		}

		return $thumb_title_html;
	}
}

/* Build Inline related posts shortcode based on the options from Customizer */
if (!function_exists(&#039;penci_inline_related_posts_shortcode&#039;)) {
	function penci_inline_related_posts_shortcode($beaf = false) {

		$style = get_theme_mod(&#039;penci_inlinerp_style&#039;) ? get_theme_mod(&#039;penci_inlinerp_style&#039;) : &#039;list&#039;;
		$title = penci_get_setting(&#039;penci_inlinerp_title&#039;) ? penci_get_setting(&#039;penci_inlinerp_title&#039;) : &#039;&#039;;
		$title_align = get_theme_mod(&#039;penci_inlinerp_titalign&#039;) ? get_theme_mod(&#039;penci_inlinerp_titalign&#039;) : &#039;left&#039;;
		$number = get_theme_mod(&#039;penci_inlinerp_num&#039;) ? get_theme_mod(&#039;penci_inlinerp_num&#039;) : &#039;6&#039;;
		$align = get_theme_mod(&#039;penci_inlinerp_align&#039;) ? get_theme_mod(&#039;penci_inlinerp_align&#039;) : &#039;none&#039;;
		$by = get_theme_mod(&#039;penci_inlinerp_by&#039;) ? get_theme_mod(&#039;penci_inlinerp_by&#039;) : &#039;categories&#039;;
		$order = get_theme_mod(&#039;penci_inlinerp_order&#039;) ? get_theme_mod(&#039;penci_inlinerp_order&#039;) : &#039;rand&#039;;
		$orderby = get_theme_mod(&#039;penci_inlinerp_orderby&#039;) ? get_theme_mod(&#039;penci_inlinerp_orderby&#039;) : &#039;DESC&#039;;
		$hide_thumb = get_theme_mod(&#039;penci_inlinerp_hide_thumb&#039;) ? &#039;yes&#039; : &#039;no&#039;;
		$thumb_right = get_theme_mod(&#039;penci_inlinerp_thumb_right&#039;) ? &#039;yes&#039; : &#039;no&#039;;
		$date = get_theme_mod(&#039;penci_inlinerp_date&#039;) ? &#039;no&#039; : &#039;yes&#039;;
		$views = get_theme_mod(&#039;penci_inlinerp_views&#039;) ? &#039;yes&#039; : &#039;no&#039;;
		$grid_columns = get_theme_mod(&#039;penci_inlinerp_col&#039;) ? get_theme_mod(&#039;penci_inlinerp_col&#039;) : &#039;2&#039;;

		if (true == $beaf) {
			$style = get_theme_mod(&#039;penci_inlinerp_style_insert&#039;) ? get_theme_mod(&#039;penci_inlinerp_style_insert&#039;) : &#039;list&#039;;
			$align = get_theme_mod(&#039;penci_inlinerp_align_insert&#039;) ? get_theme_mod(&#039;penci_inlinerp_align_insert&#039;) : &#039;none&#039;;
			$by = get_theme_mod(&#039;penci_inlinerpis_by&#039;) ? get_theme_mod(&#039;penci_inlinerpis_by&#039;) : &#039;categories&#039;;
			$order = get_theme_mod(&#039;penci_inlinerpis_order&#039;) ? get_theme_mod(&#039;penci_inlinerpis_order&#039;) : &#039;rand&#039;;
			$orderby = get_theme_mod(&#039;penci_inlinerpis_orderby&#039;) ? get_theme_mod(&#039;penci_inlinerpis_orderby&#039;) : &#039;DESC&#039;;
		}

		$shortcode = &#039;[inline_related_posts style=&quot;&#039; . $style . &#039;&quot; title=&quot;&#039; . esc_attr($title) . &#039;&quot; title_align=&quot;&#039; . $title_align . &#039;&quot; number=&quot;&#039; . $number . &#039;&quot; align=&quot;&#039; . $align . &#039;&quot; by=&quot;&#039; . $by . &#039;&quot; order=&quot;&#039; . $order . &#039;&quot; orderby=&quot;&#039; . $orderby . &#039;&quot; hide_thumb=&quot;&#039; . $hide_thumb . &#039;&quot; thumb_right=&quot;&#039; . $thumb_right . &#039;&quot; date=&quot;&#039; . $date . &#039;&quot; views=&quot;&#039; . $views . &#039;&quot; grid_columns=&quot;&#039; . $grid_columns . &#039;&quot;]&#039;;

		return $shortcode;
	}
}

if (get_theme_mod(&#039;penci_ads_inside_content_html&#039;) || get_theme_mod(&#039;penci_show_inlinerp_inside&#039;)) {
	require &#039;inc/modules/insert_ads.php&#039;;
}

if (!function_exists(&#039;penci_insert_post_content_ads&#039;) &amp;&amp; get_theme_mod(&#039;penci_ads_inside_content_html&#039;)) {
	add_filter(&#039;the_content&#039;, &#039;penci_insert_post_content_ads&#039;);
	function penci_insert_post_content_ads($content) {
		// Check if the plugin WP Insert Content is activated.
		if (!function_exists(&#039;PenciDesign\Insert_Content\insert_content&#039;)) {
			return $content;
		}

		// Check if we&#039;re inside the main loop in a single post page.
		if (!(!is_admin() &amp;&amp; is_single() &amp;&amp; in_the_loop() &amp;&amp; is_main_query())) {
			// Nope.
			return $content;
		}

		$ad_code = &#039;&lt;div class=&quot;penci-custom-html-inside-content&quot;&gt;&#039; . get_theme_mod(&#039;penci_ads_inside_content_html&#039;) . &#039;&lt;/div&gt;&#039;;
		$numpara = get_theme_mod(&#039;penci_ads_inside_content_num&#039;) ? get_theme_mod(&#039;penci_ads_inside_content_num&#039;) : 4;

		$args = array(
			&#039;parent_element_id&#039; =&gt; &#039;&#039;,
			&#039;insert_element&#039; =&gt; &#039;div&#039;,
			&#039;insert_after_p&#039; =&gt; &#039;&#039;,
			&#039;insert_every_p&#039; =&gt; $numpara,
			&#039;insert_if_no_p&#039; =&gt; false,
			&#039;top_level_p_only&#039; =&gt; true,
		);

		if (get_theme_mod(&#039;penci_ads_inside_content_style&#039;) == &#039;style-2&#039;) {
			$args[&#039;insert_after_p&#039;] = $numpara;
			$args[&#039;insert_every_p&#039;] = &#039;&#039;;
		}

		$content = PenciDesign\Insert_Content\insert_content($content, $ad_code, $args);

		return $content;
	}
}

/* Inline related posts hooks to the_content() */
if (!function_exists(&#039;penci_insert_post_content_inline_rltposts&#039;) &amp;&amp; get_theme_mod(&#039;penci_show_inlinerp_inside&#039;)) {
	add_filter(&#039;the_content&#039;, &#039;penci_insert_post_content_inline_rltposts&#039;);
	function penci_insert_post_content_inline_rltposts($content) {
		// Check if the plugin WP Insert Content is activated.
		if (!function_exists(&#039;PenciDesign\Insert_Content\insert_content&#039;)) {
			return $content;
		}

		if ( get_theme_mod( &#039;penci_inlinerp_hide_mobile&#039; ) &amp;&amp; penci_is_mobile() ) {
			return $content;
		}

		// Check if we&#039;re inside the main loop in a single post page.
		if (!(!is_admin() &amp;&amp; is_single() &amp;&amp; in_the_loop() &amp;&amp; is_main_query())) {
			// Nope.
			return $content;
		}

		$shortcode = penci_inline_related_posts_shortcode(true);
		$inline_rtlposts = &#039;&lt;div class=&quot;penci-ilrltpost-insert&quot;&gt;&#039; . $shortcode . &#039;&lt;/div&gt;&#039;;
		$numpara = get_theme_mod(&#039;penci_show_inlinerp_p&#039;) ? get_theme_mod(&#039;penci_show_inlinerp_p&#039;) : 4;

		$args = array(
			&#039;parent_element_id&#039; =&gt; &#039;&#039;,
			&#039;insert_element&#039; =&gt; &#039;div&#039;,
			&#039;insert_after_p&#039; =&gt; &#039;&#039;,
			&#039;insert_every_p&#039; =&gt; $numpara,
			&#039;insert_if_no_p&#039; =&gt; false,
			&#039;top_level_p_only&#039; =&gt; true,
		);

		if (get_theme_mod(&#039;penci_show_inlinerp_inside&#039;) == &#039;norepeat&#039;) {
			$args[&#039;insert_after_p&#039;] = $numpara;
			$args[&#039;insert_every_p&#039;] = &#039;&#039;;
		}

		$content = PenciDesign\Insert_Content\insert_content($content, $inline_rtlposts, $args);

		return $content;
	}
}

if (!function_exists(&#039;penci_insert_inline_rltposts_before_after&#039;) &amp;&amp; get_theme_mod(&#039;penci_show_inlinerp&#039;)) {
	add_filter(&#039;the_content&#039;, &#039;penci_insert_inline_rltposts_before_after&#039;);
	function penci_insert_inline_rltposts_before_after($content) {
		// Check if we&#039;re inside the main loop in a single post page.
		if (!(!is_admin() &amp;&amp; is_single() &amp;&amp; in_the_loop() &amp;&amp; is_main_query())) {
			// Nope.
			return $content;
		}

		$pos = get_theme_mod(&#039;penci_show_inlinerp&#039;);
		$shortcode = penci_inline_related_posts_shortcode();
		$inline_rtlposts = &#039;&lt;div class=&quot;penci-ilrltpost-beaf&quot;&gt;&#039; . do_shortcode($shortcode) . &#039;&lt;/div&gt;&#039;;

		if (&#039;before&#039; == $pos || &#039;be_af&#039; == $pos) {
			$content = $inline_rtlposts . $content;
		}

		if (&#039;after&#039; == $pos || &#039;be_af&#039; == $pos) {
			$content = $content . $inline_rtlposts;
		}

		return $content;
	}
}

/**
 * Get image title by image ID
 *
 * @since 5.2
 */
if (!function_exists(&#039;penci_add_meta_description_home&#039;)) {
	function penci_add_meta_description_home() {
		if (is_home() &amp;&amp; get_theme_mod(&#039;penci_home_metadesc&#039;)) {
			$meta_description = esc_attr(get_theme_mod(&#039;penci_home_metadesc&#039;));
			echo &#039;&lt;meta name=&quot;description&quot; content=&quot;&#039; . $meta_description . &#039;&quot;/&gt;&#039;;
		}
	}
	add_action(&#039;wp_head&#039;, &#039;penci_add_meta_description_home&#039;, 1);
}

/**
 * Hook to change gallery
 *
 * @since 2.4.2
 */
if (!get_theme_mod(&#039;penci_post_disable_gallery&#039;)):
	include trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/modules/gallery.php&#039;;
endif;

if (!function_exists(&#039;penci_get_ratio_img_basedid&#039;)) {
	function penci_get_ratio_img_basedid($id, $thumb = &#039;full&#039;) {
		$ratio = &#039;66.6666667&#039;;
		$image = wp_get_attachment_image_src($id, $thumb);

		if (!empty($image)) {
			$img_width = isset($image[1]) ? $image[1] : &#039;&#039;;
			$img_height = isset($image[2]) ? $image[2] : &#039;&#039;;
			if ($img_width &amp;&amp; $img_height) {
				$ratio = number_format(($img_height / $img_width) * 100, 8);
			}
		}

		$output = &#039;&lt;span class=&quot;penci-isotope-padding&quot; style=&quot;padding-bottom:&#039; . $ratio . &#039;%;&quot;&gt;&lt;/span&gt;&#039;;

		return $output;
	}
}

/**
 * Hook to change markup for gallery
 *
 * @since 2.3
 */
if (!function_exists(&#039;penci_custom_markup_for_gallery&#039;) &amp;&amp; !get_theme_mod(&#039;penci_post_disable_gallery&#039;)) {
	add_filter(&#039;post_gallery&#039;, &#039;penci_custom_markup_for_gallery&#039;, 10, 3);
	function penci_custom_markup_for_gallery($string, $attr) {

		/* Support Enhanced Media Library plugin */
		if (function_exists(&#039;wpuxss_eml_shortcode_atts&#039;)) {
			$attr = shortcode_atts(
				// defaults values
				array(
					&#039;order&#039; =&gt; &#039;&#039;,
					&#039;orderby&#039; =&gt; &#039;&#039;,
					&#039;id&#039; =&gt; &#039;&#039;,
					&#039;ids&#039; =&gt; &#039;&#039;,
					&#039;type&#039; =&gt; &#039;justified&#039;,
					&#039;columns&#039; =&gt; &#039;&#039;,
					&#039;include&#039; =&gt; &#039;&#039;,
				),
				$attr,
				&#039;gallery&#039;
			);
		}

		$data_height = &#039;150&#039;;
		if (is_numeric(get_theme_mod(&#039;penci_image_height_gallery&#039;)) &amp;&amp; (60 &lt; get_theme_mod(&#039;penci_image_height_gallery&#039;))) {
			$data_height = get_theme_mod(&#039;penci_image_height_gallery&#039;);
		}

		$id = &#039;&#039;;
		$type = &#039;justified&#039;;
		$columns = &#039;3&#039;;

		if (get_theme_mod(&#039;penci_gallery_dstyle&#039;)) {
			$type = get_theme_mod(&#039;penci_gallery_dstyle&#039;);
		}

		if (isset($attr[&#039;ids&#039;])) {
			$id = $attr[&#039;ids&#039;];
		}
		if (isset($attr[&#039;type&#039;])) {
			$type_name = $attr[&#039;type&#039;];
			if (in_array($type_name, array(&#039;justified&#039;, &#039;masonry&#039;, &#039;grid&#039;, &#039;single-slider&#039;, &#039;thumbnail-slider&#039;, &#039;none&#039;, &#039;3d&#039;))) {
				$type = $attr[&#039;type&#039;];
			}
		}
		if ($type == &#039;grid&#039;):
			$type = &#039;masonry grid&#039;;
		endif;

		if (isset($attr[&#039;columns&#039;]) &amp;&amp; in_array($attr[&#039;columns&#039;], array(&#039;2&#039;, &#039;3&#039;, &#039;4&#039;))) {
			$columns = $attr[&#039;columns&#039;];
		}

		if ($type == &#039;none&#039;) {
			return;}
		$slider_id = rand(1000, 100000);
		$block_id = &#039;penci-post-gallery__&#039; . $slider_id;
		$order = isset($attr[&#039;order&#039;]) ? $attr[&#039;order&#039;] : &#039;&#039;;
		$orderby = isset($attr[&#039;orderby&#039;]) ? $attr[&#039;orderby&#039;] : &#039;&#039;;
		$posts = get_posts(
			array(
				&#039;include&#039; =&gt; $id,
				&#039;post_type&#039; =&gt; &#039;attachment&#039;,
				&#039;order&#039; =&gt; $order,
				&#039;orderby&#039; =&gt; $orderby,
			)
		);
		$ex_class = &#039;&#039;;

		if ($type == &#039;thumbnail-slider&#039;) {
			$ex_class = &#039; penci-image-gallery-thumbnail-slider &#039;;
		}
		
		if ($type == &#039;3d&#039;) {
			$ex_class = &#039; penci-image-gallery-3d &#039;;
		}

		$output = &#039;&lt;div data-sliderid=&quot;&#039; . $slider_id . &#039;&quot; id=&quot;&#039; . $block_id . &#039;&quot; class=&quot;penci-post-gallery-container &#039; . $ex_class . $type . &#039; column-&#039; . $columns . &#039;&quot; data-height=&quot;&#039; . $data_height . &#039;&quot; data-margin=&quot;3&quot;&gt;&#039;;

		if ($type == &#039;masonry&#039; || $type == &#039;masonry grid&#039;):
			$output .= &#039;&lt;div class=&quot;inner-gallery-masonry-container&quot;&gt;&#039;;
		endif;

		if ($type == &#039;3d&#039;):
			$output .= &#039;&lt;div class=&quot;inner-gallery-3d-container&quot;&gt;&lt;div class=&quot;pcgallery-3d-wrap&quot;&gt;&#039;;
		endif;

		if ($type == &#039;single-slider&#039;):
			$autoplay = !get_theme_mod(&#039;penci_disable_autoplay_single_slider&#039;) ? &#039;true&#039; : &#039;false&#039;;
			$output .= &#039;&lt;div class=&quot;penci-owl-carousel swiper penci-owl-carousel-slider penci-nav-visible&quot; data-auto=&quot;&#039; . $autoplay . &#039;&quot; data-lazy=&quot;true&quot;&gt;&lt;div class=&quot;swiper-wrapper&quot;&gt;&#039;;
		endif;

		if ($type == &#039;thumbnail-slider&#039;):
			$output .= &#039;&lt;div data-id=&quot;pcthumb-m-&#039; . $slider_id . &#039;&quot; class=&quot;swiper penci-slick-carousel pcthumb-s-msl pcthumb-m-&#039; . $slider_id . &#039;&quot;&gt;&lt;div class=&quot;swiper-wrapper&quot;&gt;&#039;;
		endif;

		$thumbnail_html = &#039;&#039;;

		if ($posts) {
			foreach ($posts as $imagePost) {
				$caption = &#039;&#039;;
				$gallery_title = &#039;&#039;;
				if ($imagePost-&gt;post_excerpt):
					$caption = $imagePost-&gt;post_excerpt;
				endif;
				if ($caption) {
					$gallery_title = &#039; data-cap=&quot;&#039; . esc_attr($caption) . &#039;&quot;&#039;;
				}

				$get_full = wp_get_attachment_image_src($imagePost-&gt;ID, &#039;full&#039;);
				$get_masonry = wp_get_attachment_image_src($imagePost-&gt;ID, &#039;penci-masonry-thumb&#039;);
				$thumbsize = &#039;penci-masonry-thumb&#039;;

				$image_alt = penci_get_image_alt($imagePost-&gt;ID, get_the_ID());
				$image_title_html = penci_get_image_title($imagePost-&gt;ID);

				$class_a_item = &#039;penci-gallery-ite&#039;;
				if (!($type == &#039;masonry&#039; || $type == &#039;masonry grid&#039;)) {
					$class_a_item = &#039;penci-gallery-ite item-gallery-&#039; . $type;
				}

				if ($type == &#039;masonry&#039; || $type == &#039;masonry grid&#039; || $type == &#039;single-slider&#039; || $type == &#039;thumbnail-slider&#039;) {
					$class_a_item .= &#039; item-link-relative&#039;;
				}

				if ($type == &#039;single-slider&#039; || $type == &#039;thumbnail-slider&#039;):
					$output .= &#039;&lt;figure class=&quot;swiper-slide&quot;&gt;&#039;;
					$get_masonry = wp_get_attachment_image_src($imagePost-&gt;ID, &#039;penci-full-thumb&#039;);
					$thumbsize = &#039;penci-full-thumb&#039;;
				endif;

				if ($type == &#039;masonry grid&#039;):
					$get_masonry = wp_get_attachment_image_src($imagePost-&gt;ID, &#039;penci-thumb&#039;);
					$thumbsize = &#039;penci-thumb&#039;;
				endif;

				if ($type == &#039;masonry&#039; || $type == &#039;masonry grid&#039;) {
					$output .= &#039;&lt;div class=&quot;item-gallery-&#039; . $type . &#039;&quot;&gt;&#039;;
				}

				$output .= &#039;&lt;a class=&quot;&#039; . $class_a_item . &#039;&quot; href=&quot;&#039; . $get_full[0] . &#039;&quot;&#039; . $gallery_title . &#039;&gt;&#039;;

				if ($type == &#039;masonry&#039; || $type == &#039;masonry grid&#039;):
					$output .= &#039;&lt;div class=&quot;inner-item-masonry-gallery&quot;&gt;&#039;;
				endif;

				if ($type == &#039;masonry&#039; || $type == &#039;masonry grid&#039; || $type == &#039;single-slider&#039; || $type == &#039;thumbnail-slider&#039;) {
					$output .= penci_get_ratio_img_basedid($imagePost-&gt;ID, $thumbsize);
				}

				$output .= &#039;&lt;img src=&quot;&#039; . $get_masonry[0] . &#039;&quot; alt=&quot;&#039; . $image_alt . &#039;&quot;&#039; . $image_title_html . &#039;&gt;&#039;;

				if ($type == &#039;justified&#039; &amp;&amp; $caption) {
					$output .= &#039;&lt;div class=&quot;caption&quot;&gt;&#039; . wp_kses(
						$caption,
						array(
							&#039;em&#039; =&gt; array(),
							&#039;strong&#039; =&gt; array(),
							&#039;b&#039; =&gt; array(),
							&#039;i&#039; =&gt; array(),
						)
					) . &#039;&lt;/div&gt;&#039;;
				}

				if ($type == &#039;masonry&#039; || $type == &#039;masonry grid&#039;):
					$output .= &#039;&lt;/div&gt;&#039;;
				endif;

				$output .= &#039;&lt;/a&gt;&#039;;

				// Close item-gallery-&#039; . $style_gallery . &#039;-wrap
				if ($type == &#039;masonry&#039; || $type == &#039;masonry grid&#039;) {
					$output .= &#039;&lt;/div&gt;&#039;;
				}

				if ($type == &#039;single-slider&#039; || $type == &#039;thumbnail-slider&#039;):
					if ($caption):
						$output .= &#039;&lt;p class=&quot;penci-single-gallery-captions&quot;&gt;&#039; . $caption . &#039;&lt;/p&gt;&#039;;
					endif;
					$output .= &#039;&lt;/figure&gt;&#039;;
				endif;

				if ($type == &#039;thumbnail-slider&#039;) {
					$get_thumbnail_slider_img = wp_get_attachment_image_src($imagePost-&gt;ID, &#039;thumbnail&#039;);
					$thumbnail_html .= &#039;&lt;div class=&quot;pcgl-thumb-item swiper-slide&quot;&gt;&lt;div class=&quot;pcgl-thumb-item-img&quot;&gt;&lt;span class=&quot;penci-image-holder&quot; style=&quot;background-image:url(&#039; . $get_thumbnail_slider_img[0] . &#039;)&quot;&gt;&lt;/div&gt;&lt;/div&gt;&#039;;
				}
			}
		}

		if ($type == &#039;masonry&#039; || $type == &#039;single-slider&#039; || $type == &#039;masonry grid&#039; || $type == &#039;thumbnail-slider&#039;):
			$output .= &#039;&lt;/div&gt;&#039;;
		endif;

		if ($type == &#039;thumbnail-slider&#039; || $type == &#039;single-slider&#039;):
			$output .= &#039;&lt;/div&gt;&#039;;
		endif;
		
		if ($type == &#039;3d&#039;):
			$output .= &#039;&lt;/div&gt;&lt;/div&gt;&#039;;
		endif;

		if ($type == &#039;thumbnail-slider&#039;) {
			$nav = &#039;&lt;div class=&quot;penci-slick-carousel-top-nav&quot;&gt;&lt;div class=&quot;pcslick-nav-area&quot;&gt;&lt;div class=&quot;pcslick-nav&quot;&gt;&lt;button type=&quot;button&quot; class=&quot;slick-prev&quot;&gt;&lt;i class=&quot;penciicon-left-chevron&quot;&gt;&lt;/i&gt;&lt;/button&gt;&lt;button type=&quot;button&quot; class=&quot;slick-next&quot;&gt;&lt;i class=&quot;penciicon-right-chevron&quot;&gt;&lt;/i&gt;&lt;/button&gt;&lt;/div&gt;&lt;div class=&quot;slider-num&quot;&gt;&lt;span class=&quot;current&quot;&gt;1&lt;/span&gt;&#039; . __(&#039; of &#039;, &#039;soledad&#039;) . &#039;&lt;span class=&quot;total&quot;&gt;&#039; . count($posts) . &#039;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&#039;;
			$output .= &#039;&lt;div data-cols=&quot;7&quot; data-total=&quot;&#039;.count($posts).&#039;&quot; data-id=&quot;pcthumb-c-&#039; . $slider_id . &#039;&quot; class=&quot;swiper pcthumb-s-csl pcgl-thumb-slider penci-slick-carousel pcthumb-c-&#039; . $slider_id . &#039;&quot;&gt;&lt;div class=&quot;swiper-wrapper&quot;&gt;&#039; . $thumbnail_html . &#039;&lt;/div&gt;&#039;.$nav.&#039;&lt;/div&gt;&#039;;
		}

		$output .= &#039;&lt;/div&gt;&#039;;

		return $output;
	}
}

/*
 * Create filter to hide header &amp; footer
 */
if (!function_exists(&#039;penci_is_hide_header&#039;)) {
	function penci_is_hide_header() {
		$return = false;

		return apply_filters(&#039;penci_filter_hide_header&#039;, $return);
	}
}

if (!function_exists(&#039;penci_is_hide_footer&#039;)) {
	function penci_is_hide_footer() {
		$return = false;

		return apply_filters(&#039;penci_filter_hide_footer&#039;, $return);
	}
}

/**
 * Get next/prev posts data for current posts
 */
if (!function_exists(&#039;penci_get_next_prev_posts&#039;)) {
	function penci_get_next_prev_posts() {

		$type = get_theme_mod(&#039;penci_loadnp_type&#039;) ? get_theme_mod(&#039;penci_loadnp_type&#039;) : &#039;prev&#039;;
		$exclude = get_theme_mod(&#039;penci_loadnp_exclude&#039;) ? get_theme_mod(&#039;penci_loadnp_exclude&#039;) : &#039;&#039;;
		$return = get_previous_post(false, $exclude);

		if ($type == &#039;next&#039;) {
			$return = get_next_post(false, $exclude);
		} elseif ($type == &#039;prev_cat&#039;) {
			$return = get_previous_post(true, $exclude, &#039;category&#039;);
		} elseif ($type == &#039;next_cat&#039;) {
			$return = get_next_post(true, $exclude, &#039;category&#039;);
		} elseif ($type == &#039;prev_tag&#039;) {
			$return = get_previous_post(true, $exclude, &#039;post_tag&#039;);
		} elseif ($type == &#039;next_tag&#039;) {
			$return = get_next_post(true, $exclude, &#039;post_tag&#039;);
		}

		return $return;
	}
}

if (!function_exists(&#039;penci_soledad_time_link&#039;)):
	/**
	 * Gets a nicely formatted string for the published date.
	 */
	function penci_soledad_time_link($single = null, $dformat = null) {
		$get_the_date = get_the_date(DATE_W3C);
		$get_the_time = get_the_time(get_option(&#039;date_format&#039;));
		$get_the_datem = get_the_modified_date(DATE_W3C);
		$get_the_timem = get_the_modified_date(get_option(&#039;date_format&#039;));
		$classes = &#039;published&#039;;
		$format = get_theme_mod(&#039;penci_date_format&#039;);
		if (&#039;timeago&#039; == $dformat) {
			$format = &#039;timeago&#039;;
		} elseif (&#039;normal&#039; == $dformat) {
			$format = &#039;normal&#039;;
		}
		$text_prefix_e = get_theme_mod( &#039;penci_addpre_date_text&#039;);

		$text_prefix = $text_prefix_e ? &#039;&lt;span&gt;&#039;.penci_get_setting(&#039;penci_trans_published&#039;).&#039;&lt;/span&gt; &#039; : &#039;&#039;;

	if ($single == null || (is_single() &amp;&amp; !get_theme_mod(&#039;penci_single_publishmodified&#039;))) {
		if (get_theme_mod(&#039;penci_show_modified_date&#039;)) {
			$get_the_date = $get_the_datem;
			$get_the_time = $get_the_timem;
		}

		if (&#039;timeago&#039; == $format) {
			$current_time = current_time(&#039;timestamp&#039;);
			$post_time = get_the_time(&#039;U&#039;);
			if (get_theme_mod(&#039;penci_show_modified_date&#039;)) {
				$post_time = get_the_modified_time(&#039;U&#039;);
			}
			if ($current_time &gt; $post_time) {
				$get_the_time = penci_get_setting(&#039;penci_trans_beforeago&#039;) . &#039; &#039; . human_time_diff($post_time, $current_time) . &#039; &#039; . penci_get_setting(&#039;penci_trans_tago&#039;);
			}
		}

		

		$time_string = &#039;&lt;time class=&quot;entry-date published&quot; datetime=&quot;%1$s&quot;&gt;&#039; .$text_prefix.&#039;%2$s&lt;/time&gt;&#039;;
		
		if (get_the_modified_time(&#039;Y-m-d&#039;) &gt; get_the_time(&#039;Y-m-d&#039;)) {
			if (get_theme_mod(&#039;penci_show_modified_date&#039;)) {
				$classes = &#039;updated&#039;;
				$text_prefix = $text_prefix_e ? &#039;&lt;span&gt;&#039;.penci_get_setting(&#039;penci_trans_modifiedat&#039;).&#039;&lt;/span&gt; &#039; : &#039;&#039;;
			
			}
			$time_string = &#039;&lt;time class=&quot;entry-date &#039; . $classes . &#039;&quot; datetime=&quot;%1$s&quot;&gt;&#039; .$text_prefix. &#039;%2$s&lt;/time&gt;&#039;;
		}

		printf(
			$time_string,
			$get_the_date,
			$get_the_time
		);
	} elseif (is_single() &amp;&amp; get_theme_mod(&#039;penci_single_publishmodified&#039;)) {
		if (get_the_time(&#039;Y-m-d&#039;) &gt;= get_the_modified_time(&#039;Y-m-d&#039;)) {
			if (&#039;timeago&#039; == $format) {
				$current_time = current_time(&#039;timestamp&#039;);
				$post_time = get_the_time(&#039;U&#039;);
				if (get_theme_mod(&#039;penci_show_modified_date&#039;)) {
					$post_time = get_the_modified_time(&#039;U&#039;);
				}
				if ($current_time &gt; $post_time) {
					$get_the_time = penci_get_setting(&#039;penci_trans_beforeago&#039;) . &#039; &#039; . human_time_diff($post_time, $current_time) . &#039; &#039; . penci_get_setting(&#039;penci_trans_tago&#039;);
				}
			} else {
				$get_the_time = $text_prefix.$get_the_time;
			}


			$time_string = &#039;&lt;time class=&quot;entry-date published&quot; datetime=&quot;%1$s&quot;&gt;%2$s&lt;/time&gt;&#039;;
			printf(
				$time_string,
				$get_the_date,
				$get_the_time
			);
		} else {

			$time_string = &#039;&lt;strong&gt;%1$s&lt;/strong&gt; &lt;time class=&quot;entry-date published&quot; datetime=&quot;%2$s&quot;&gt;%3$s&lt;/time&gt;&lt;/span&gt;&lt;span&gt;&lt;strong&gt;%4$s&lt;/strong&gt; &lt;time class=&quot;entry-date modified&quot; datetime=&quot;%5$s&quot;&gt;%6$s&lt;/time&gt;&#039;;
			printf(
				$time_string,
				penci_get_setting(&#039;penci_trans_published&#039;),
				$get_the_date,
				$get_the_time,
				penci_get_setting(&#039;penci_trans_modifiedat&#039;),
				$get_the_datem,
				$get_the_timem
			);
		}
	}
}
endif;

if (!function_exists(&#039;penci_soledad_meta_schema&#039;)) {
	/**
	 * Gets a nicely formatted string for the published date.
	 */
	function penci_soledad_meta_schema() {
		if (!get_theme_mod(&#039;penci_schema_hentry&#039;)) {
			?&gt;
		&lt;div class=&quot;penci-hide-tagupdated&quot;&gt;
			&lt;span class=&quot;author-italic author vcard&quot;&gt;&lt;?php echo penci_get_setting(&#039;penci_trans_by&#039;); ?&gt; &lt;?php
if (function_exists(&#039;coauthors_posts_links&#039;)):
				penci_coauthors_posts_links();
			else:
			?&gt;
										&lt;?php echo penci_author_meta_html(); ?&gt;
									&lt;?php endif;?&gt;&lt;/span&gt;
			&lt;?php if ( !is_page() ){ penci_soledad_time_link(); } ?&gt;
		&lt;/div&gt;
			&lt;?php
}
	}
}

if (!function_exists(&#039;penci_get_the_title&#039;)) {
	function penci_get_the_title($post = 0) {

		$post = get_post($post);
		$title = isset($post-&gt;post_title) ? $post-&gt;post_title : &#039;&#039;;

		return $title;
	}
}

if (!function_exists(&#039;penci_soledad_social_share&#039;)) {
	function penci_soledad_social_share($pos = &#039;&#039;,$echo=true) {

		$list_social = array(
			&#039;facebook&#039;,
			&#039;twitter&#039;,
			&#039;pinterest&#039;,
			&#039;linkedin&#039;,
			&#039;tumblr&#039;,
			&#039;vk&#039;,
			&#039;ok&#039;,
			&#039;reddit&#039;,
			&#039;stumbleupon&#039;,
			&#039;whatsapp&#039;,
			&#039;telegram&#039;,
			&#039;line&#039;,
			&#039;link&#039;,
			&#039;pocket&#039;,
			&#039;skype&#039;,
			&#039;viber&#039;,
			&#039;threads&#039;,
			&#039;bluesky&#039;,
			&#039;flipboard&#039;,
			&#039;chatgpt&#039;,
			&#039;perplexity&#039;,
			&#039;email&#039;,
		);

		$option_prefix = &#039;penci__hide_share_&#039;;

		$output = &#039;&#039;;

		$count = 1;

		foreach ($list_social as $k =&gt; $social_key) {
			$list_social_item = penci_get_setting($option_prefix . $social_key);
			if ($list_social_item) {
				continue;
			}

			$class = &#039;new-ver-share&#039;;

			$link = get_permalink();
			$text = penci_get_the_title();
			$img_link = get_the_post_thumbnail_url();

			switch ($social_key) {
			case &#039;facebook&#039;:
				$facebook_share = &#039;https://www.facebook.com/sharer/sharer.php?u=&#039; . get_the_permalink();
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-facebook&quot; aria-label=&quot;Share on Facebook&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($facebook_share) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-facebook-f&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Facebook&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;
			case &#039;twitter&#039;:
				$twitter_text = &#039;Check out this article&#039;;
				if (get_theme_mod(&#039;penci_post_twitter_share_text&#039;)) {
					$twitter_text = do_shortcode(get_theme_mod(&#039;penci_post_twitter_share_text&#039;));
				}
				$twitter_text = trim($twitter_text);

				$twitter_share = &#039;https://x.com/intent/tweet?text=&#039; . rawurlencode($twitter_text) . &#039;:%20&#039; . rawurlencode($text) . &#039;%20-%20&#039; . get_the_permalink();
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-twitter&quot; aria-label=&quot;Share on Twitter&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($twitter_share) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;penciicon-x-twitter&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Twitter&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;

				break;
			case &#039;pinterest&#039;:
				if (&#039;single&#039; == $pos) {
					$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-pinterest&quot; aria-label=&quot;Pin to Pinterest&quot; data-pin-do=&quot;none&quot; &#039; . penci_reltag_social_icons() . &#039; onclick=&quot;var e=document.createElement(\&#039;script\&#039;);&#039;;
					$output .= &#039;e.setAttribute(\&#039;type\&#039;,\&#039;text/javascript\&#039;);&#039;;
					$output .= &#039;e.setAttribute(\&#039;charset\&#039;,\&#039;UTF-8\&#039;);&#039;;
					$output .= &#039;e.setAttribute(\&#039;src\&#039;,\&#039;//assets.pinterest.com/js/pinmarklet.js?r=\&#039;+Math.random()*99999999);&#039;;
					$output .= &#039;document.body.appendChild(e);&#039;;
					$output .= &#039;&quot;&gt;&#039;;
					$output .= penci_icon_by_ver(&#039;fab fa-pinterest&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Pinterest&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				} else {
					$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-pinterest&quot; aria-label=&quot;Pin to Pinterest&quot; data-pin-do=&quot;none&quot; &#039; . penci_reltag_social_icons() . &#039; target=&quot;_blank&quot; href=&quot;&#039;;
					$output .= &#039;https://www.pinterest.com/pin/create/button/?url=&#039; . urlencode($link);
					if (has_post_thumbnail()) {
						$output .= &#039;&amp;media=&#039; . urlencode($img_link);
					}
					if ($text) {
						$output .= &#039;&amp;description=&#039; . urlencode($text);}
					$output .= &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-pinterest&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Pinterest&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				}

				break;

			case &#039;linkedin&#039;:
				$link = htmlentities(
					add_query_arg(
						array(
							&#039;url&#039; =&gt; rawurlencode($link),
							&#039;title&#039; =&gt; rawurlencode($text),
						),
						&#039;https://www.linkedin.com/shareArticle?mini=true&#039;
					)
				);

				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-linkedin&quot; aria-label=&quot;Share on LinkedIn&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-linkedin-in&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Linkedin&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;tumblr&#039;:
				$link = htmlentities(
					add_query_arg(
						array(
							&#039;url&#039; =&gt; rawurlencode($link),
							&#039;name&#039; =&gt; rawurlencode($text),
						),
						&#039;https://www.tumblr.com/share/link&#039;
					)
				);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-tumblr&quot; aria-label=&quot;Share on Tumblr&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-tumblr&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Tumblr&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;messenger&#039;:
				$link = htmlentities(
					add_query_arg(
						array(
							&#039;link&#039; =&gt; rawurlencode($link),
							&#039;redirect_uri&#039; =&gt; rawurlencode($text),
						),
						&#039;https://www.facebook.com/dialog/send?app_id=5303202981&amp;display=popup&#039;
					)
				);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-messenger show-on-mobile&quot; aria-label=&quot;Share on Messenger&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;fb-messenger://share?app_id=5303202981&amp;display=popup&amp;link=&#039; . rawurlencode($link) . &#039;&amp;redirect_uri=&#039; . rawurlencode($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;penciicon-messenger&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Messenger&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-messenger show-on-desktop&quot; aria-label=&quot;Share on Messenger&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;penciicon-messenger&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Messenger&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;vk&#039;:
				$link = &#039;https://vk.com/share.php?url=&#039; . get_the_permalink();
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-vk&quot; aria-label=&quot;Share on VK&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-vk&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;VK&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;ok&#039;:
				$link = &#039;https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&amp;st.shareUrl=&#039; . $link . &#039;&amp;amp;description=&#039; . $text . &#039;&amp;amp;media=&#039; . $img_link;
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-ok&quot; aria-label=&quot;Share on Odnoklassniki&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-odnoklassniki&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Odnoklassniki&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;reddit&#039;:
				$link = htmlentities(
					add_query_arg(
						array(
							&#039;url&#039; =&gt; rawurlencode($link),
							&#039;title&#039; =&gt; rawurlencode($text),
						),
						&#039;https://reddit.com/submit&#039;
					)
				);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-reddit&quot; aria-label=&quot;Share on Reddit&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-reddit-alien&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Reddit&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;stumbleupon&#039;:
				$link = htmlentities(
					add_query_arg(
						array(
							&#039;url&#039; =&gt; rawurlencode($link),
							&#039;title&#039; =&gt; rawurlencode($text),
						),
						&#039;https://www.stumbleupon.com/submit&#039;
					)
				);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-stumbleupon&quot; aria-label=&quot;Share on Stumbleupon&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-stumbleupon&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Stumbleupon&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;email&#039;:
				$link = esc_url(&#039;mailto:?subject=&#039; . $text . &#039;&amp;BODY=&#039; . $link);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-email&quot; target=&quot;_blank&quot; aria-label=&quot;Share via Email&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fas fa-envelope&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Email&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;
			
			case &#039;link&#039;:
				$link = esc_url($link);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-link&quot; target=&quot;_blank&quot; aria-label=&quot;Copy Post Link&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fas fa-link&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Copy Link&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;telegram&#039;:
				$link = htmlentities(
					add_query_arg(
						array(
							&#039;url&#039; =&gt; rawurlencode($link),
							&#039;text&#039; =&gt; rawurlencode($text),
						),
						&#039;https://telegram.me/share/url&#039;
					)
				);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-telegram&quot; aria-label=&quot;Share on Telegram&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-telegram&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Telegram&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;whatsapp&#039;:
				$link = htmlentities(
					add_query_arg(
						array(
							&#039;text&#039; =&gt; rawurlencode($text) . &#039; %0A%0A &#039; . rawurlencode($link),
						),
						&#039;https://api.whatsapp.com/send&#039;
					)
				);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-whatsapp&quot; aria-label=&quot;Share on Whatsapp&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . ($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-whatsapp&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Whatsapp&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;line&#039;:
				$line_share = &#039;https://line.me/R/msg/text/?&#039; . rawurlencode($text) . &#039;%20&#039; . rawurlencode($link);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-line&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($line_share) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;penciicon-line&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;LINE&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;pocket&#039;:
				$link = &#039;https://getpocket.com/save?title=&#039; . $text . &#039;&amp;amp;url=&#039; . $link;
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-pocket&quot; aria-label=&quot;Share on Pocket&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-get-pocket&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Pocket&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;skype&#039;:
				$link = &#039;https://web.skype.com/share?url=&#039; . $link . &#039;&amp;text=&#039; . $text;
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-skype&quot; aria-label=&quot;Share on Skype&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;fab fa-skype&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Skype&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;viber&#039;:
				$link = &#039;viber://forward?text=&#039; . rawurlencode($text) . &#039;%20&#039; . rawurlencode($link);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-viber&quot; aria-label=&quot;Share on Viber&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . ($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;penciicon-viber&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Viber&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;
				
			case &#039;threads&#039;:
				$link = &#039;https://threads.net/intent/post?text=&#039; . rawurlencode($text) . &#039;&amp;amp;url=&#039; . rawurlencode($link);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-threads&quot; aria-label=&quot;Share on Threads&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . ($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;penciicon-threads&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Threads&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;
				
			case &#039;bluesky&#039;:
				$link = &#039;https://bsky.app/intent/compose?text=&#039; . rawurlencode($text) . &#039;%20&#039; . rawurlencode($link);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-bluesky&quot; aria-label=&quot;Share on Bluesky&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . ($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;penciicon-butterfly&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Bluesky&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;flipboard&#039;:
				$link = &#039;https://share.flipboard.com/bookmarklet/popout?v=2&amp;title=&#039; . rawurlencode($text) . &#039;&amp;url=&#039; . rawurlencode($link);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-flipboard&quot; aria-label=&quot;Share on Flipboard&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . esc_url($link) . &#039;&quot;&gt;&#039; . penci_icon_by_ver(&#039;penciicon-flipboard&#039;, &#039;&#039;, true) . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Flipboard&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;chatgpt&#039;:
				$svg_icon = &#039;&lt;i class=&quot;penci-faicon penciicon-chatgpt&quot;&gt;&lt;svg fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; height=&quot;1em&quot; style=&quot;flex:none;line-height:1&quot; viewBox=&quot;0 0 24 24&quot; width=&quot;1em&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;title&gt;OpenAI&lt;/title&gt;&lt;path d=&quot;M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/i&gt;&#039;;
				$chatgpt_promp = &#039;Visit this URL: &#039; . get_permalink() . &#039; and summarize its content.&#039;;
				$link = &#039;https://chat.openai.com/?q=&#039; . rawurlencode($chatgpt_promp);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-chatgpt&quot; aria-label=&quot;Share on ChatGPT&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . ($link) . &#039;&quot;&gt;&#039; . $svg_icon . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;ChatGPT&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			case &#039;perplexity&#039;:
				$svg_icon = &#039;&lt;i class=&quot;penci-faicon penciicon-perplexity&quot;&gt;&lt;svg fill=&quot;currentColor&quot; fill-rule=&quot;evenodd&quot; height=&quot;1em&quot; style=&quot;flex:none;line-height:1&quot; viewBox=&quot;0 0 24 24&quot; width=&quot;1em&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;title&gt;Perplexity&lt;/title&gt;&lt;path d=&quot;M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/i&gt;&#039;;
				$perplexity_promp = &#039;Visit this URL: &#039; . get_permalink() . &#039; and summarize its content.&#039;;
				$link = &#039;https://www.perplexity.ai/search/new?q=&#039; . rawurlencode($perplexity_promp);
				$output .= &#039;&lt;a class=&quot;&#039; . $class . &#039; post-share-item post-share-perplexity&quot; aria-label=&quot;Share on Perplexity AI&quot; target=&quot;_blank&quot; &#039; . penci_reltag_social_icons() . &#039; href=&quot;&#039; . ($link) . &#039;&quot;&gt;&#039; . $svg_icon . &#039;&lt;span class=&quot;dt-share&quot;&gt;&#039; . esc_html__(&#039;Perplexity AI&#039;, &#039;soledad&#039;) . &#039;&lt;/span&gt;&lt;/a&gt;&#039;;
				break;

			default:
				$output .= &#039;&#039;;
				break;
			}
		}

		if ( ( is_single() || is_page() ) &amp;&amp; $output != &#039;&#039; ) {
			$output .= &#039;&lt;a class=&quot;post-share-item post-share-expand&quot; href=&quot;#&quot; aria-label=&quot;Share Expand&quot;&gt;&#039; . penci_icon_by_ver(&#039;penciicon-add&#039;, &#039;&#039;, true) . &#039;&lt;/a&gt;&#039;;
		}

		if ($output &amp;&amp; $echo ) {
			if (&#039;single&#039; == $pos) {
				echo &#039;&lt;div class=&quot;list-posts-share&quot;&gt;&#039;;
			}
			echo $output;

			if (&#039;single&#039; == $pos) {
				echo &#039;&lt;/div&gt;&#039;;
			}
		} else {
			return $output;
		}
	}
}

if (!function_exists(&#039;penci_get_single_style&#039;)) {
	function penci_get_single_style() {
		static $single_style;
		$single_style = &#039;style-1&#039;;

		$style_psingle = penci_get_single_key( get_the_ID(), &#039;penci_single_style&#039; );
		if ($style_psingle) {
			$single_style = $style_psingle;

			return $single_style;
		}

		$style = get_theme_mod(&#039;penci_single_style&#039;);
		$enable_style2 = get_theme_mod(&#039;penci_enable_single_style2&#039;);

		if (!get_theme_mod(&#039;penci_single_style&#039;) &amp;&amp; $enable_style2) {
			$single_style = &#039;style-2&#039;;
		} elseif ($style) {
			$single_style = $style;
		}

		return $single_style;
	}
}

if (!function_exists(&#039;penci_get_primary_cat_id&#039;)) {
	function penci_get_primary_cat_id($taxonomy_name = &#039;category&#039;) {
		$primary_term_id = &#039;&#039;;

		if (!function_exists(&#039;yoast_get_primary_term_id&#039;) &amp;&amp; !class_exists(&#039;RankMath&#039;)) {
			$the_category = get_the_category();
			if (!empty($the_category)) {
				$primary_term_id = $the_category[0]-&gt;term_id;
			}
		}

		$soledad_primary_term_id = get_post_meta( get_the_ID(), &#039;pcpricat_primary_&#039;.$taxonomy_name, true );

		$primary_term_id = $soledad_primary_term_id ? $soledad_primary_term_id : $primary_term_id;

		// Get primary cat from Yoast
		if (function_exists(&#039;yoast_get_primary_term_id&#039;)) {
			$primary_term_id = yoast_get_primary_term_id($taxonomy_name, get_the_id());
		}
		// Get primary cat from Rank Math
		if (class_exists(&#039;RankMath&#039;)) {
			$primary_term_id = get_post_meta(get_the_id(), &#039;rank_math_primary_category&#039;, true);
		}

		return $primary_term_id;
	}
}

if (!function_exists(&#039;penci_get_wpseo_primary_term&#039;)) {
	function penci_get_wpseo_primary_term($taxonomy_name = &#039;category&#039;) {
		$primary_term_id = penci_get_primary_cat_id($taxonomy_name);
		if ($primary_term_id) {
			$term = get_term($primary_term_id, $taxonomy_name);

			if (is_wp_error($term)) {
				return &#039;&#039;;
			}

			// Primary category
			$category_display = $term-&gt;name;
			$category_link = get_category_link($term-&gt;term_id);

			return &#039;&lt;span&gt;&lt;a class=&quot;crumb&quot; href=&quot;&#039; . esc_url($category_link) . &#039;&quot;&gt;&#039; . $category_display . &#039;&lt;/a&gt;&lt;/span&gt;&#039; . penci_icon_by_ver(&#039;fas fa-angle-right&#039;);
		}
	}
}

/**
 * Exclude specific categories from latest posts on Homepage
 *
 * @since 2.4
 */
if (!function_exists(&#039;penci_exclude_specific_categories_display_on_home2&#039;)) {
	function penci_exclude_specific_categories_display_on_home2($query) {

		$feat_query = penci_global_query_featured_slider();

		if (get_theme_mod(&#039;penci_exclude_featured_cat&#039;) &amp;&amp; $feat_query &amp;&amp; $query-&gt;is_main_query() &amp; is_home()) {

			$list_post_ids = array();
			if ($feat_query-&gt;have_posts()) {
				while ($feat_query-&gt;have_posts()):
					$feat_query-&gt;the_post();
					$list_post_ids[] = get_the_ID();
				endwhile;
				wp_reset_postdata();
			}

			if (!$list_post_ids) {
				return $query;
			}

			$query-&gt;set(&#039;post__not_in&#039;, $list_post_ids);
		}
		return $query;
	}

	add_action(&#039;pre_get_posts&#039;, &#039;penci_exclude_specific_categories_display_on_home2&#039;);
}

if (!function_exists(&#039;penci_get_query_related_posts_type&#039;)) {
	function penci_get_query_related_posts_type($id, $based, $orderby, $order, $numbers) {
		$post_type = get_post_type($id);
		return array(
			&#039;post_type&#039; =&gt; $post_type,
			&#039;ignore_sticky_posts&#039; =&gt; 1,
			&#039;posts_per_page&#039; =&gt; $numbers,
			&#039;post__not_in&#039; =&gt; array($id),
			&#039;orderby&#039; =&gt; $orderby,
			&#039;order&#039; =&gt; $order,
		);
	}
}

/**
 * Get query for related posts of current posts
 *
 * Return $array
 */
if (!function_exists(&#039;penci_get_query_related_posts&#039;)) {
	function penci_get_query_related_posts($id, $based, $orderby, $order, $numbers) {

		$return = array();
		$post_type = get_post_type($id);

		if ( &#039;post&#039; != $post_type ) {
			return penci_get_query_related_posts_type( $id, $based, $orderby, $order, $numbers );
		}

		$categories = get_the_category($id);
		$primary_catid = penci_get_primary_cat_id();
		if (&#039;primary_cat&#039; == $based &amp;&amp; $primary_catid) {
			$term = get_term($primary_catid);
			if (!is_wp_error($term)) {
				$categories = array($term);
			}
		}

		if (&#039;tags&#039; == $based):
			$categories = wp_get_post_terms($id, &#039;post_tag&#039;, array(&#039;fields&#039; =&gt; &#039;ids&#039;));
		endif;

		if ($categories) {
			if ($based == &#039;tags&#039;) {
				$return = array(
					&#039;post_type&#039; =&gt; $post_type,
					&#039;ignore_sticky_posts&#039; =&gt; 1,
					&#039;posts_per_page&#039; =&gt; $numbers,
					&#039;tax_query&#039; =&gt; array(
						array(
							&#039;taxonomy&#039; =&gt; &#039;post_tag&#039;,
							&#039;terms&#039; =&gt; $categories,
						),
					),
					&#039;post__not_in&#039; =&gt; array($id),
					&#039;orderby&#039; =&gt; $orderby,
					&#039;order&#039; =&gt; $order,
				);
			} else {
				$category_ids = array();
				$featured_cat = &#039;&#039;;
				/* Get featured category when slider is enabled */
				if (get_theme_mod(&#039;penci_featured_slider&#039;) &amp;&amp; (get_theme_mod(&#039;penci_featured_slider_filter_type&#039;) != &#039;tags&#039;)):
					$featured_cat = get_theme_mod(&#039;penci_featured_cat&#039;);
				endif;

				foreach ($categories as $individual_category) {
					/* Remove featured slider categories to related posts */
					$term_related = $individual_category-&gt;term_id;
					if (!get_theme_mod(&#039;penci_post_related_exclusive_cat&#039;) || (get_theme_mod(&#039;penci_post_related_exclusive_cat&#039;) &amp;&amp; ($term_related != $featured_cat))) {
						$category_ids[] = $term_related;
					}
				}

				$return = array(
					&#039;category__in&#039; =&gt; $category_ids,
					&#039;post__not_in&#039; =&gt; array($id),
					&#039;posts_per_page&#039; =&gt; $numbers,
					&#039;ignore_sticky_posts&#039; =&gt; 1,
					&#039;orderby&#039; =&gt; $orderby,
					&#039;order&#039; =&gt; $order,
				);
			}

			if (&#039;popular&#039; == $orderby) {
				$return[&#039;meta_key&#039;] = penci_get_postviews_key();
				$return[&#039;orderby&#039;] = &#039;meta_value_num&#039;;
			} elseif (&#039;popular_day&#039; == $orderby) {
				$return[&#039;meta_key&#039;] = &#039;penci_post_day_views_count&#039;;
				$return[&#039;orderby&#039;] = &#039;meta_value_num&#039;;
			} elseif (&#039;popular7&#039; == $orderby) {
				$return[&#039;meta_key&#039;] = &#039;penci_post_week_views_count&#039;;
				$return[&#039;orderby&#039;] = &#039;meta_value_num&#039;;
			} elseif (&#039;popular_month&#039; == $orderby) {
				$return[&#039;meta_key&#039;] = &#039;penci_post_month_views_count&#039;;
				$return[&#039;orderby&#039;] = &#039;meta_value_num&#039;;
			} elseif (&#039;jetpack&#039; == $orderby) {
				$return[&#039;meta_key&#039;] = &#039;_jetpack_post_view&#039;;
				$return[&#039;orderby&#039;] = &#039;meta_value_num&#039;;
			} elseif ( &#039;most_liked&#039; == $orderby ) {
				$return[&#039;meta_key&#039;] = &#039;_post_like_count&#039;;
				$return[&#039;orderby&#039;]  = &#039;meta_value_num&#039;;
			}
		}

		return $return;
	}
}

/**
 * Get class for detect sidebar use for single posts page.
 *
 * Return $string
 */
if (!function_exists(&#039;penci_get_posts_sidebar_class&#039;)) {
	function penci_get_posts_sidebar_class() {
		$sidebar_customize = get_theme_mod(&#039;penci_single_layout&#039;) ? get_theme_mod(&#039;penci_single_layout&#039;) : &#039;right-sidebar&#039;;
		
		$priid = penci_get_post_pri_cat();
		if ( $priid ) {
			$cat_options = get_option( &quot;category_$priid&quot; );
			$override = isset( $cat_options[&#039;cat_sidebar_single&#039;] ) ? $cat_options[&#039;cat_sidebar_single&#039;] : &#039;&#039;;
			if ( $override ) {
				$cat_sidebar = isset( $cat_options[&#039;cat_sidebar_display&#039;] ) ? $cat_options[&#039;cat_sidebar_display&#039;] : &#039;&#039;;
				if ( $cat_sidebar ): $sidebar_opts = $cat_sidebar; endif;
			}
		}
		
		
		$sidebar_opts = penci_get_single_key(get_the_ID(), &#039;penci_post_sidebar_display&#039;);
		$sidebar_pos = $sidebar_opts ? $sidebar_opts : $sidebar_customize;

		$sidebar_position = &#039;&#039;;
		if ($sidebar_pos == &#039;left&#039;) {
			$sidebar_position = &#039;left-sidebar&#039;;
		} elseif ($sidebar_pos == &#039;right&#039;) {
			$sidebar_position = &#039;right-sidebar&#039;;
		} elseif ($sidebar_pos == &#039;two&#039;) {
			$sidebar_position = &#039;two-sidebar&#039;;
		}

		return $sidebar_position;
	}
}

/**
 * Apply logo image to WP Block Embed
 *
 * Return $string
 */
add_filter(&#039;get_site_icon_url&#039;, &#039;penci_custom_wp_block_embedded_icon&#039;);
if (!function_exists(&#039;penci_custom_wp_block_embedded_icon&#039;)) {
	function penci_custom_wp_block_embedded_icon($url) {
		$icon = get_theme_mod(&#039;penci_favicon&#039;);
		if ($icon) {
			return $icon;
		} else {
			return $url;
		}
	}
}
if (!function_exists(&#039;penci_custom_login_logo_url&#039;)) {
	function penci_custom_login_logo_url($url) {
		if (get_theme_mod(&#039;activate_white_label&#039;)) {
			return get_bloginfo(&#039;url&#039;);
		} else {
			return $url;
		}
	}
}
add_filter(&#039;login_headerurl&#039;, &#039;penci_custom_login_logo_url&#039;, 10, 1);

/**
 * Check if single has sidebar or not
 *
 * Return $string
 */
if (!function_exists(&#039;penci_single_sidebar_return&#039;)) {
	function penci_single_sidebar_return() {

		$single_sidebar = true;
		$sidebar_old = get_theme_mod(&#039;penci_sidebar_posts&#039;);
		$sidebar_customize = get_theme_mod(&#039;penci_single_layout&#039;);

		$priid = penci_get_post_pri_cat();
		if ( $priid ) {
			$cat_options = get_option( &quot;category_$priid&quot; );
			$override = isset( $cat_options[&#039;cat_sidebar_single&#039;] ) ? $cat_options[&#039;cat_sidebar_single&#039;] : &#039;&#039;;
			if ( $override ) {
				$cat_sidebar = isset( $cat_options[&#039;cat_sidebar_display&#039;] ) ? $cat_options[&#039;cat_sidebar_display&#039;] : &#039;&#039;;
				if ( $cat_sidebar ): $sidebar_opts = $cat_sidebar; endif;
			}
		}


		$sidebar_opts = penci_get_single_key( get_the_ID(), &#039;penci_post_sidebar_display&#039; );

		if ($sidebar_opts == &#039;no&#039; || $sidebar_opts == &#039;small_width&#039;) {
			$single_sidebar = false;
		} elseif (!$sidebar_opts) {
			if ($sidebar_customize == &#039;no&#039; || $sidebar_customize == &#039;small_width&#039;) {
				$single_sidebar = false;
			} elseif (!get_theme_mod(&#039;penci_single_layout&#039;)) {
				if (!penci_get_setting(&#039;penci_sidebar_posts&#039;)) {
					$single_sidebar = false;
				}
			}
		}

		return $single_sidebar;
	}
}

/**
 * Get inline-ads markup
 */
if (!function_exists(&#039;penci_get_markup_infeed_ad&#039;)) {
	function penci_get_markup_infeed_ad($args) {

		$defaults = array(
			&#039;wrapper&#039; =&gt; &#039;div&#039;,
			&#039;classes&#039; =&gt; &#039;penci-infeed-ads&#039;,
			&#039;fullwidth&#039; =&gt; &#039;&#039;,
			&#039;order_ad&#039; =&gt; 3,
			&#039;order_post&#039; =&gt; &#039;&#039;,
			&#039;code&#039; =&gt; &#039;&#039;,
			&#039;echo&#039; =&gt; false,
		);

		$parse = wp_parse_args($args, $defaults);

		$before = $after = $order_ad = $order_post = $code = &#039;&#039;;
		extract($parse);

		if (($order_post % $order_ad != 0) || !$code) {
			return;
		}

		if (&#039;full&#039; == $fullwidth) {
			$classes = $classes . &#039; penci-infeed-fullwidth-ads&#039;;
			$wrapper = &#039;div&#039;;
		}

		$output = &#039;&lt;&#039; . $wrapper . &#039; class=&quot;&#039; . $classes . &#039;&quot;&gt;&#039;;
		$output .= &#039;&lt;div class=&quot;penci-inner-infeed-data&quot;&gt;&#039;;
		$output .= penci_safe_shortcode($code);
		$output .= &#039;&lt;/div&gt;&#039;;
		$output .= &#039;&lt;/&#039; . $wrapper . &#039;&gt;&#039;;

		if (!$parse[&#039;echo&#039;]) {
			return $output;
		}

		echo $output;
	}
}

/**
 * Check showing reading time or not
 *
 * $option - the option to passed show/hide reading time
 */
if (!function_exists(&#039;penci_isshow_reading_time&#039;)) {
	function penci_isshow_reading_time($option) {
		$return = false;
		$post_id = get_the_ID();
		if ($post_id) {
			$default_reading = penci_estimate_readingtime($post_id);
			$reading_time = get_post_meta($post_id, &#039;penci_reading_time&#039;, true);
			if (($reading_time || $default_reading) &amp;&amp; !$option) {
				$return = true;
			}
		}

		return $return;
	}
}

/**
 * Get reading time data
 */
if (!function_exists(&#039;penci_reading_time&#039;)) {
	function penci_reading_time($echo = true, $post_id = null) {

		if (empty($post_id)) {
			$post_id = get_the_ID();
		}
		$return = penci_estimate_readingtime($post_id);
		if ($post_id) {
			$reading_time = get_post_meta($post_id, &#039;penci_reading_time&#039;, true);
			if ($reading_time) {
				$return = $reading_time;
			}
		}

		if ($return &amp;&amp; penci_get_setting(&#039;penci_trans_read&#039;)) {
			$return = $return . &#039; &#039; . penci_get_setting(&#039;penci_trans_read&#039;);
		}

		if ($echo == false) {
			return $return;
		}

		echo $return;
	}
}

/*
 * run do_shortcode for get_theme_mod
 */
if (!function_exists(&#039;penci_theme_mod&#039;)) {
	function penci_theme_mod($option) {
		if (!get_theme_mod($option)) {
			return false;
		} else {
			return do_shortcode(get_theme_mod($option));
		}
	}
}

/**
 * Check if single has layout smaller content
 *
 * Return $string
 */
if (!function_exists(&#039;penci_single_smaller_content_enable&#039;)) {
	function penci_single_smaller_content_enable() {

		$single_smaller_content = false;
		$sidebar_customize = get_theme_mod(&#039;penci_single_layout&#039;);
		$sidebar_opts = penci_get_single_key(get_the_ID(), &#039;penci_post_sidebar_display&#039;);

		if ($sidebar_opts == &#039;small_width&#039;) {
			$single_smaller_content = true;
		} elseif (!$sidebar_opts) {
			if ($sidebar_customize == &#039;small_width&#039;) {
				$single_smaller_content = true;
			}
		}

		return $single_smaller_content;
	}
}

if (!function_exists(&#039;penci_get_query_featured_slider&#039;)) {
	function penci_get_query_featured_slider() {

		if (!get_theme_mod(&#039;penci_exclude_featured_cat&#039;)) {
			$feat_query = penci__query_featured_slider();
		} else {
			$feat_query = penci_global_query_featured_slider();
			if (!$feat_query) {
				$feat_query = penci__query_featured_slider();
			}
		}
		return $feat_query;
	}
}

if (!function_exists(&#039;penci_global_query_featured_slider&#039;)) {
	function penci_global_query_featured_slider() {
		$feat_query = array();
		if (isset($GLOBALS[&#039;penci_query_featured_slider&#039;]) &amp;&amp; $GLOBALS[&#039;penci_query_featured_slider&#039;]) {
			$feat_query = $GLOBALS[&#039;penci_query_featured_slider&#039;];
		}
		return $feat_query;
	}
}

if (!function_exists(&#039;penci__query_featured_slider&#039;)):
	function penci__query_featured_slider() {
		$feat_query = array();
		if (get_theme_mod(&#039;penci_featured_slider&#039;)) {
			$slider_style = get_theme_mod(&#039;penci_featured_slider_style&#039;) ? get_theme_mod(&#039;penci_featured_slider_style&#039;) : &#039;style-1&#039;;

			if (in_array($slider_style, array(&#039;style-31&#039;, &#039;style-32&#039;))) {
				return array();
			}

			$featured_cat = get_theme_mod(&#039;penci_featured_cat&#039;);
			$number = get_theme_mod(&#039;penci_featured_slider_slides&#039;);

			if (!$number) {
				$number = 6;
				if (in_array($slider_style, array(&#039;style-7&#039;, &#039;style-8&#039;, &#039;style-10&#039;, &#039;style-19&#039;, &#039;style-23&#039;, &#039;style-24&#039;, &#039;style-25&#039;))) {
					$number = 8;
				} elseif (in_array($slider_style, array(&#039;style-17&#039;, &#039;style-18&#039;, &#039;style-20&#039;, &#039;style-21&#039;, &#039;style-26&#039;, &#039;style-27&#039;))) {
				$number = 10;
			} elseif (in_array($slider_style, array(&#039;style-22&#039;, &#039;style-28&#039;))) {
				$number = 14;
			} elseif ($number &lt; 3 &amp;&amp; $slider_style == &#039;style-37&#039;) {
				$number = 6;
			}
		}
		$featured_args = array(
			&#039;posts_per_page&#039; =&gt; $number,
			&#039;post_type&#039; =&gt; &#039;post&#039;,
			&#039;post_status&#039; =&gt; &#039;publish&#039;,
		);

		if (!get_theme_mod(&#039;penci_featured_tags&#039;) || get_theme_mod(&#039;penci_featured_slider_filter_type&#039;) != &#039;tags&#039;) {
			if ($featured_cat &amp;&amp; &#039;0&#039; != $featured_cat):
				$featured_args[&#039;cat&#039;] = $featured_cat;
			endif;
		} elseif (get_theme_mod(&#039;penci_featured_tags&#039;) &amp;&amp; get_theme_mod(&#039;penci_featured_slider_filter_type&#039;) == &#039;tags&#039;) {
			$list_tag = get_theme_mod(&#039;penci_featured_tags&#039;);
			$list_tag_trim = str_replace(&#039; &#039;, &#039;&#039;, $list_tag);
			$list_tags = explode(&#039;,&#039;, $list_tag_trim);
			$featured_args[&#039;tax_query&#039;] = array(
				array(
					&#039;taxonomy&#039; =&gt; &#039;post_tag&#039;,
					&#039;field&#039; =&gt; &#039;slug&#039;,
					&#039;terms&#039; =&gt; $list_tags,
				),
			);
		}

		$orderby = get_theme_mod(&#039;featured_slider_orderby&#039;);
		$order = get_theme_mod(&#039;featured_slider_order&#039;);

		$featured_args[&#039;orderby&#039;] = $orderby ? $orderby : &#039;date&#039;;
		$featured_args[&#039;order&#039;] = $order ? $order : &#039;DESC&#039;;

		$feat_query = new WP_Query($featured_args);
	}

	return $feat_query;
}
endif;

if (!function_exists(&#039;penci_set_query_featured_slider&#039;)):
	function penci_set_query_featured_slider() {

		$query = array();
		if (get_theme_mod(&#039;penci_exclude_featured_cat&#039;)) {
			$query = penci__query_featured_slider();
		}

		$GLOBALS[&#039;penci_query_featured_slider&#039;] = $query;
	}
	add_action(&#039;init&#039;, &#039;penci_set_query_featured_slider&#039;);
endif;

if (!function_exists(&#039;penci_reltag_social_icons&#039;)):
	function penci_reltag_social_icons() {
		$dataref = get_theme_mod(&#039;penci_rel_type_social&#039;) ? get_theme_mod(&#039;penci_rel_type_social&#039;) : &#039;noreferrer&#039;;
		$data_return = str_replace(&#039;_&#039;, &#039; &#039;, $dataref);
		if (&#039;none&#039; != $data_return) {
			$return = &#039; rel=&quot;&#039; . $data_return . &#039;&quot;&#039;;
		} else {
			$return = &#039;&#039;;
		}

		return $return;
	}
endif;

/* Allow Upload SVG &amp; JSon &amp; Some file types */
if (!function_exists(&#039;penci_allows_upload_custom_file_types&#039;)) {
	function penci_allows_upload_custom_file_types($mimes) {
		$mimes[&#039;json&#039;] = &#039;text/plain&#039;;
		$mimes[&#039;svg&#039;] = &#039;image/svg+xml&#039;;
		$mimes[&#039;csv&#039;] = &#039;text/csv&#039;;
		$mimes[&#039;svgz&#039;] = &#039;image/svg+xml&#039;;
		$mimes[&#039;doc&#039;] = &#039;application/msword&#039;;

		return $mimes;
	}
	add_filter(&#039;upload_mimes&#039;, &#039;penci_allows_upload_custom_file_types&#039;);
}

/* Get typo data for WPBakery */
if (!function_exists(&#039;penci_soledad_vc_extract_font_prop&#039;)) {
	function penci_soledad_vc_extract_font_prop($param) {
		if (function_exists(&#039;vc_parse_multi_attribute&#039;)) {
			$typo = vc_parse_multi_attribute($param);
			$prop = &#039;&#039;;
			unset($typo[&#039;tag&#039;]);
			foreach ($typo as $tag =&gt; $properties) {
				$prop .= str_replace(&#039;_&#039;, &#039;-&#039;, $tag) . &#039;:&#039; . $properties . &#039;;&#039;;
			}

			return $prop;
		}
	}
}

/* Detect if is using Gutenberg editor or not */
if (!function_exists(&#039;penci_is_using_gutenberg&#039;)) {
	function penci_is_using_gutenberg() {
		$return = false;
		$wp_version = $GLOBALS[&#039;wp_version&#039;];
		if (version_compare($wp_version, &#039;5.0-beta&#039;, &#039;&gt;&#039;)) {
			$edit_screen = get_current_screen();
			if ($edit_screen &amp;&amp; method_exists($edit_screen, &#039;is_block_editor&#039;) &amp;&amp; $edit_screen-&gt;is_block_editor()) {
				$return = true;
			}
		}
		return $return;
	}
}

/* Filter support post type for meta boxes */
if (!function_exists(&#039;penci_post_types_allow_meta_boxes&#039;)) {
	function penci_post_types_allow_meta_boxes() {
		$default = array(&#039;post&#039;);

		// Filter to add more allow post type
		$allow_post_type = apply_filters(&#039;penci_filter_allow_post_type&#039;, $default);

		if (!empty($allow_post_type) &amp;&amp; is_array($allow_post_type)) {
			return $allow_post_type;
		}

		return $default;
	}
}

/* Get the sub title for posts */
if (!function_exists(&#039;penci_display_post_subtitle&#039;)) {
	function penci_display_post_subtitle($class = &#039;&#039;, $echo = true) {
		$sub_title = get_post_meta(get_the_ID(), &#039;penci_post_sub_title&#039;, true);
		$html_return = &#039;&#039;;
		if ($sub_title) {
			$html_return = &#039;&lt;h2 class=&quot;penci-psub-title &#039; . $class . &#039;&quot;&gt;&#039; . $sub_title . &#039;&lt;/h2&gt;&#039;;
		}

		if ($echo) {
			echo $html_return;
		} else {
			return $html_return;
		}
	}
}

if (!function_exists(&#039;penci_get_publish_post_types_for_search&#039;)) {
	function penci_get_publish_post_types_for_search($args = array()) {
		$post_type_args = array(
			// Default is the value $public.
			&#039;show_in_nav_menus&#039; =&gt; true,
		);

		if (!empty($args[&#039;post_type&#039;])) {
			$post_type_args[&#039;name&#039;] = $args[&#039;post_type&#039;];
		}

		$_post_types = get_post_types($post_type_args, &#039;objects&#039;);

		$post_types = array();

		$ex_post_types = array(
			&#039;e-landing-page&#039;,
			&#039;page&#039;,
		);

		foreach ($_post_types as $post_type =&gt; $object) {
			$post_types[$object-&gt;name] = array(
				&#039;name&#039; =&gt; $object-&gt;label,
				&#039;value&#039; =&gt; $object-&gt;name,
			);
		}

		foreach ($ex_post_types as $post_type) {
			unset($post_types[$post_type]);
		}

		return $post_types;
	}
}

if (!function_exists(&#039;penci_holder_image_base&#039;)) {
	function penci_holder_image_base($width = null, $height = null) {
		if (null == $width || null == $height || &#039;&#039; == $width || &#039;&#039; == $height) {
			$width = 3;
			$height = 2;
		}
		$return = &quot;data:image/svg+xml,%3Csvg%20xmlns=&#039;http://www.w3.org/2000/svg&#039;%20viewBox=&#039;0%200%20&quot; . $width . &#039;%20&#039; . $height . &quot;&#039;%3E%3C/svg%3E&quot;;
		/* Decode: $return = &quot;data:image/svg+xml,&lt;svg xmlns=&#039;http://www.w3.org/2000/svg&#039; viewBox=&#039;0 0 $width $height&#039;&gt;&lt;/svg&gt; */
		return esc_attr($return);
	}
}

if (!function_exists(&#039;penci_image_srcset&#039;)) {
	function penci_image_srcset($post_id, $desktop_size = &#039;full&#039;, $mobile_size = &#039;&#039;, $option = false ) {

		$return = &#039;&#039;;

		$return .= penci_get_featured_image_size($post_id, $desktop_size);

		if ($mobile_size) {
			$return .= &#039;&quot; data_bg_hidpi=&quot;&#039; . penci_get_featured_image_size($post_id, $mobile_size);
		}

		return $return;
	}
}

if (!function_exists(&#039;penci_image_img_srcset&#039;)) {
	function penci_image_img_srcset($post_id, $desktop_size = &#039;full&#039;, $mobile_size = &#039;&#039;) {

		$img_lists = array();
		$image_sizes = penci_image_size_thumb();
		if ($mobile_size &amp;&amp; isset($image_sizes[$mobile_size][&#039;width&#039;]) &amp;&amp; $image_sizes[$mobile_size][&#039;width&#039;]) {
			$img_lists[] = penci_get_featured_image_size($post_id, $mobile_size) . &#039; &#039; . $image_sizes[$mobile_size][&#039;width&#039;] . &#039;w&#039;;
		} else {
			return &#039;&#039;;
		}

		// desktop image
		$img_lists[] = penci_get_featured_image_size($post_id, $desktop_size);

		return implode(&#039;,&#039;, $img_lists);
	}
}

if (!function_exists(&#039;penci_image_size_thumb&#039;)) {
	function penci_image_size_thumb() {
		global $_wp_additional_image_sizes;

		$default_image_sizes = array(&#039;thumbnail&#039;, &#039;medium&#039;, &#039;medium_large&#039;, &#039;large&#039;);

		$image_sizes = array();

		foreach ($default_image_sizes as $size) {
			$image_sizes[$size] = array(
				&#039;width&#039; =&gt; (int) get_option($size . &#039;_size_w&#039;),
				&#039;height&#039; =&gt; (int) get_option($size . &#039;_size_h&#039;),
				&#039;crop&#039; =&gt; (bool) get_option($size . &#039;_crop&#039;),
			);
		}

		if ($_wp_additional_image_sizes) {
			$image_sizes = array_merge($image_sizes, $_wp_additional_image_sizes);
		}
		return $image_sizes;
	}
}

if (!function_exists(&#039;penci_image_datasize&#039;)) {
	function penci_image_datasize($desktop = &#039;&#039;, $mobile = &#039;&#039;) {

		$meta_size = array();

		$image_sizes = penci_image_size_thumb();

		if ($mobile) {
			$mobile_size = isset($image_sizes[$mobile][&#039;width&#039;]) &amp;&amp; $image_sizes[$mobile][&#039;width&#039;] ? $mobile : &#039;&#039;;
			if ($mobile_size) {
				$meta_size[] = &#039;(max-width: 767px) &#039; . $image_sizes[$mobile_size][&#039;width&#039;] . &#039;px&#039;;
			} else {
				return &#039;auto&#039;;
			}
		}

		$desktop_size = isset($image_sizes[$desktop]) &amp;&amp; $image_sizes[$desktop] ? $desktop : &#039;full&#039;;

		$meta_size[] = isset($image_sizes[$desktop_size][&#039;width&#039;]) ? $image_sizes[$desktop_size][&#039;width&#039;] . &#039;px&#039; : &#039;&#039;;

		return implode(&#039;, &#039;, $meta_size);
	}
}

/**
 * Exclude post types from XML sitemaps from Yoast SEO.
 *
 * @param boolean $excluded  Whether the post type is excluded by default.
 * @param string  $post_type The post type to exclude.
 *
 * @return bool Whether or not a given post type should be excluded.
 */
if (!function_exists(&#039;penci_yoast_sitemap_exclude_post_type&#039;)) {
	function penci_yoast_sitemap_exclude_post_type($excluded, $post_type) {
		if (in_array($post_type, array(&#039;archive-template&#039;, &#039;custom-post-template&#039;, &#039;penci_builder&#039;, &#039;penci-block&#039;, &#039;e-landing-page&#039;))) {
			return;
		}
	}
}
add_filter(&#039;wpseo_sitemap_exclude_post_type&#039;, &#039;penci_yoast_sitemap_exclude_post_type&#039;, 10, 2);

if (!is_admin()) {
	require PENCI_SOLEDAD_DIR . &#039;/inc/video-format.php&#039;;
	new Penci_Sodedad_Video_Format();
}
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/excerpt.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/instagram/instagram.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/twitter/dashpage.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/global-js.php&#039;;
require trailingslashit(PENCI_SOLEDAD_DIR) . &#039;soledad_vc.php&#039;;

// Visual Composer add on
if (defined(&#039;WPB_VC_VERSION&#039;)) {
	include trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/js_composer/js_composer.php&#039;;
	include trailingslashit(PENCI_SOLEDAD_DIR) . &#039;inc/js_composer/soledad_vc.php&#039;;
}

if (defined(&#039;ELEMENTOR_VERSION&#039;)) {
	require PENCI_SOLEDAD_DIR . &#039;/inc/elementor/elementor.php&#039;;
	require PENCI_SOLEDAD_DIR . &#039;/inc/blocks/blocks.php&#039;;
}

// Function work with elementor, vc, widgets
require PENCI_SOLEDAD_DIR . &#039;/inc/js_composer/inc/helper.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/json-schema-validar.php&#039;;

if (is_admin() &amp;&amp; !class_exists(&#039;RWMB_Loader&#039;)) {
	require_once PENCI_SOLEDAD_DIR . &#039;/inc/dashboard/lib/meta-box/meta-box.php&#039;;
}

if (is_admin() &amp;&amp; class_exists(&#039;RWMB_Loader&#039;)) {
	require_once PENCI_SOLEDAD_DIR . &#039;/inc/dashboard/lib/mb-settings-page/mb-settings-page.php&#039;;
	require_once PENCI_SOLEDAD_DIR . &#039;/inc/dashboard/lib/meta-box-conditional-logic/meta-box-conditional-logic.php&#039;;
}

require PENCI_SOLEDAD_DIR . &#039;/inc/dashboard/class-penci-dashboard.php&#039;;

if (function_exists(&#039;register_block_type&#039;)) {
	require PENCI_SOLEDAD_DIR . &#039;/inc/block/heading-styles/heading-title-block.php&#039;;
}

if (class_exists(&#039;WooCommerce&#039;)) {
	require PENCI_SOLEDAD_DIR . &#039;/inc/woocommerce/woocommerce.php&#039;;
}

add_action(
	&#039;init&#039;,
	function () {
		$clear_imagesizecache = isset($_GET[&#039;pcclear_imgsize&#039;]) &amp;&amp; $_GET[&#039;pcclear_imgsize&#039;] ? $_GET[&#039;pcclear_imgsize&#039;] : false;
		if ($clear_imagesizecache) {
			global $wpdb;
			$imgcache = (array) $wpdb-&gt;get_results(&quot;SELECT `option_name` FROM {$wpdb-&gt;options} WHERE `option_name` LIKE &#039;_transient_pc_idata_%&#039;&quot;, ARRAY_A);
			if (!empty($imgcache)) {
				foreach ($imgcache as $img) {
					$transient = str_replace(&#039;_transient_&#039;, &#039;&#039;, $img[&#039;option_name&#039;]);
					\delete_transient($transient);
				}
			}
		}
		if ( get_option( &#039;elementor_experiment-e_font_icon_svg&#039; ) != &#039;inactive&#039; ) {
			update_option( &#039;elementor_experiment-e_font_icon_svg&#039;, &#039;inactive&#039; );
		}
        if ( get_option( &#039;elementor_experiment-e_dom_optimization&#039; ) != &#039;inactive&#039; ) {
			update_option( &#039;elementor_experiment-e_dom_optimization&#039;, &#039;inactive&#039; );
		}
		
	}
);


require PENCI_SOLEDAD_DIR . &#039;/inc/update/bootstrap.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/ajax.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/block.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/featured_archive_posts.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/builder/penci-builder.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/data-imex/penci-imex.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/template-builder/init.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/smartlists/init.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/toc/init.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/ad_settings.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/ajax-search.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/ad_blocker.php&#039;;
if (!class_exists(&#039;Simple_Local_Avatars&#039;)) {
	require PENCI_SOLEDAD_DIR . &#039;/inc/avatar/init.php&#039;;
}
if (defined(&#039;WEBSTORIES_VERSION&#039;)) {
	require PENCI_SOLEDAD_DIR . &#039;/inc/web-stories.php&#039;;
}

require PENCI_SOLEDAD_DIR . &#039;/inc/accessibility.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/opengraph.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/user-profile.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/google_search.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/comment_ratings.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/options/options.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/links/link_options.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/mod-date.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/delayed_div.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/primary-cat/penci_primary_cat.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/maintenance.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/plugins.php&#039;;
require PENCI_SOLEDAD_DIR . &#039;/inc/dashboard/inc/optional_plugins.php&#039;;
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//todalamoda.ru/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://todalamoda.ru/post-sitemap.xml</loc>
		<lastmod>2026-10-29T20:13:52+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://todalamoda.ru/page-sitemap.xml</loc>
		<lastmod>2026-10-29T20:24:22+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://todalamoda.ru/category-sitemap.xml</loc>
		<lastmod>2026-10-29T20:13:52+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://todalamoda.ru/post_tag-sitemap.xml</loc>
		<lastmod>2026-10-29T07:11:31+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://todalamoda.ru/author-sitemap.xml</loc>
		<lastmod>2026-10-29T09:17:37+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->