<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
/* Check to see if logo image is active */
if ( ! function_exists( 'pmthemes_check_header_logo' ) ) :
    function pmthemes_check_header_logo(){
        if ( ! function_exists( 'pmthemes_default_options' ) ) {
            return false;
        }
        $theme_options = get_option( 'pmthemes_theme_options', pmthemes_default_options() );
        if ( isset($theme_options['header_logo']) && $theme_options['header_logo'] <> '' ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if static front page is active */
if ( ! function_exists( 'pmthemes_static_front_page_check' ) ) :
    function pmthemes_static_front_page_check() {
        if ( get_option( 'show_on_front' ) == 'page') {
            return true;
        }
        return false;
    }
endif;
/* Check to see if top/secondary menu is active */
if ( ! function_exists( 'pmthemes_secondary_menu_active' ) ) :
    function pmthemes_secondary_menu_active() {
        if ( has_nav_menu( 'secondary' ) ) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if WooCommerce class is active */
if ( ! function_exists( 'pmthemes_woocommerce_class_active' ) ) :
    function pmthemes_woocommerce_class_active() {
        if ( class_exists( 'WooCommerce' ) ) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if top/secondary menu is inactive */
if ( ! function_exists( 'pmthemes_secondary_menu_inactive' ) ) :
    function pmthemes_secondary_menu_inactive() {
        if ( ! has_nav_menu( 'secondary' ) ) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if Tabbed Content Widget is active */
if ( ! function_exists( 'pmthemes_tabbed_content_active' ) ) :
    function pmthemes_tabbed_content_active() {
        if ( is_active_widget(false, false, 'pmthemes_tabbed_content') ) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if Header Adjustments is active - checkbox */
if ( ! function_exists( 'pmthemes_header_adjust_active' ) ) :
    function pmthemes_header_adjust_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'header_adjust' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if Header Adjustments is active - checkbox */
if ( ! function_exists( 'pmthemes_sidebar_padding_adjust_active' ) ) :
    function pmthemes_sidebar_padding_adjust_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'sidebar_padding_adjust' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if Enable FB Open Graph Meta is enabled */
if ( ! function_exists( 'pmthemes_fb_meta_graph_active' ) ) :
    function pmthemes_fb_meta_graph_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'fb_meta_graph' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if header line is active and if top nav is down */
if ( ! function_exists( 'pmthemes_header_line_active' ) ) :
    function pmthemes_header_line_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( $theme_options[ 'header_line_enable' ] == true and ( $theme_options[ 'topnav_down' ] == true)) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if top navigation is down */
if ( ! function_exists( 'pmthemes_is_navi_top_down' ) ) :
    function pmthemes_is_navi_top_down() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( $theme_options[ 'topnav_down' ] ) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if navigation top border is enabled */
if ( ! function_exists( 'pmthemes_navi_top_bd_clr_enabled' ) ) :
    function pmthemes_navi_top_bd_clr_enabled() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( $theme_options[ 'navi_top_bd_enb' ] ) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if navigation bottom border is enabled */
if ( ! function_exists( 'pmthemes_navi_bot_bd_clr_enabled' ) ) :
    function pmthemes_navi_bot_bd_clr_enabled() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( $theme_options[ 'navi_bot_bd_enb' ] ) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if item border is enabled */
if ( ! function_exists( 'pmthemes_navi_item_border_enabled' ) ) :
    function pmthemes_navi_item_border_enabled() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( $theme_options[ 'navi_border_enable' ] ) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if dropdown border is enabled */
if ( ! function_exists( 'pmthemes_dropdown_border_enabled' ) ) :
    function pmthemes_dropdown_border_enabled() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( $theme_options[ 'navi_dropdown_noborder' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if Title Shadow is active */
if ( ! function_exists( 'pmthemes_site_title_shadow_active' ) ) :
    function pmthemes_site_title_shadow_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'site_title_shadis' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if site tagline is active */
if ( ! function_exists( 'pmthemes_site_tagline_active' ) ) :
    function pmthemes_site_tagline_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'header_tagline' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if top bar is active */
if ( ! function_exists( 'pmthemes_top_bar_active' ) ) :
    function pmthemes_top_bar_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'topbar_show' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if header gradient is enabled*/
if ( ! function_exists( 'pmthemes_header_gradient_active' ) ) :
    function pmthemes_header_gradient_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'header_gradient_enable' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if sidebar gradient is enabled*/
if ( ! function_exists( 'pmthemes_sidebar_gradient_active' ) ) :
    function pmthemes_sidebar_gradient_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'sidebar_gradient_enable' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if footer widget gradient is enabled*/
if ( ! function_exists( 'pmthemes_fwidget_gradient_active' ) ) :
    function pmthemes_fwidget_gradient_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'fwidget_gradient_enable' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if header top border settings is active */
if ( ! function_exists( 'pmthemes_header_top_border_active' ) ) :
    function pmthemes_header_top_border_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'header_top_border_enable' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if header bottom border settings is active */
if ( ! function_exists( 'pmthemes_header_bottom_border_active' ) ) :
    function pmthemes_header_bottom_border_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'header_bottom_border_enable' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if wide header is selected */
if ( ! function_exists( 'pmthemes_wide_header_active' ) ) :
    function pmthemes_wide_header_active() {
        if ( ! function_exists( 'pmthemes_default_options' ) ) {
            return false;
        }
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        return ( 'wide-head' == $theme_options[ 'theme_style' ] );
    }
endif;
/* Check to see if top border color is active - enable type */
if ( ! function_exists( 'pmthemes_header_top_border_activxxx' ) ) :
    function pmthemes_header_top_border_activated() {
        if ( ! function_exists( 'pmthemes_default_options' ) ) {
            return false;
        }
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        return ( 'enable' == $theme_options[ 'header_topbo' ] ) ? true : false;
    }
endif;
/* Check to see excerpt on archive is selected */
if ( ! function_exists( 'pmthemes_archive_excerpt_length' ) ) :
    function pmthemes_archive_excerpt_length() {
        if ( ! function_exists( 'pmthemes_default_options' ) ) {
            return false;
        }
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        return ( 'excerpt' == $theme_options[ 'posts_length' ] );
    }
endif;
/* Check to see if Widget Header Styling is active  */
if ( ! function_exists( 'pmthemes_widget_header_style_active' ) ) :
    function pmthemes_widget_header_style_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'widget_header_styling' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if Frontpage Header Styling is active  */
if ( ! function_exists( 'pmthemes_frontpage_header_style_active' ) ) :
    function pmthemes_frontpage_header_style_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'frontpage_header_style' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if slider content is active  */
if ( ! function_exists( 'pmthemes_show_slider_content_active' ) ) :
    function pmthemes_show_slider_content_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'show_slider_content' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if sidebar border is enabled  */
if ( ! function_exists( 'pmthemes_sidebar_border_active' ) ) :
    function pmthemes_sidebar_border_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'show_sidebar_border' ] ) {
            return false;
        }
        return true;
    }
endif;

/* Check to see if grid column option is active  */
if ( ! function_exists( 'pmthemes_pmth_grid_coln_active' ) ) :
    function pmthemes_pmth_grid_coln_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( $theme_options[ 'pmth_grid_col_opt' ] == 'pmth-grid-coln') {
            return true;
        }
        return false;
    }
endif;

/* Check to see if grid item width option is active  */
if ( ! function_exists( 'pmthemes_pmth_grid_itemw_active' ) ) :
    function pmthemes_pmth_grid_itemw_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( $theme_options[ 'pmth_grid_col_opt' ] == 'pmth-grid-itmw') {
            return true;
        }
        return false;
    }
endif;
/* Check to see if archive image is active */
if ( ! function_exists( 'pmthemes_archive_images_active' ) ) :
    function pmthemes_archive_images_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'post_thumbnails_index' ] ) {
            return false;
        }
        return true;
    }
endif;
/* Check to see if scroll to top is active */
if ( ! function_exists( 'pmthemes_scroll_top_active' ) ) :
    function pmthemes_scroll_top_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( $theme_options[ 'link_to_top' ] ) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if comment is open and if is single */
if ( ! function_exists( 'pmthemes_comment_btn_active' ) ) :
    function pmthemes_comment_btn_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( ! $theme_options[ 'hide_post_comment' ] and is_single ()) {
            return true;
        }
        return false;
    }
endif;
/* Check to see if slider is active */
if ( ! function_exists( 'pmthemes_post_slider_active' ) ) :
    function pmthemes_post_slider_active() {
        $theme_options = wp_parse_args( get_option( 'pmthemes_theme_options', array() ),
            pmthemes_default_options()
        );
        if ( $theme_options[ 'slider_activated_front_page' ] ) {
            return true;
        }
        return false;
    }
endif;