__('Primary Menu', 'zerif-lite'), )); /* Enable support for Post Formats. */ add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link')); /* Setup the WordPress core custom background feature. */ if( file_exists(get_stylesheet_directory() . "/images/bg.jpg") ) { $zerif_default_image = get_stylesheet_directory_uri() . "/images/bg.jpg"; } else { $zerif_default_image = get_template_directory_uri() . "/images/bg.jpg"; } add_theme_support('custom-background', apply_filters('zerif_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => $zerif_default_image, ))); /* Enable support for HTML5 markup. */ add_theme_support('html5', array( 'comment-list', 'search-form', 'comment-form', 'gallery', )); /* Enable support for title-tag */ add_theme_support( 'title-tag' ); /* Enable support for custom logo */ add_theme_support( 'custom-logo', array( 'flex-width' => true, ) ); /* Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /* Custom functions that act independently of the theme templates. */ require get_template_directory() . '/inc/extras.php'; /* Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /* tgm-plugin-activation */ require_once get_template_directory() . '/class-tgm-plugin-activation.php'; /* woocommerce support */ add_theme_support( 'woocommerce' ); /* selective widget refresh */ add_theme_support( 'customize-selective-refresh-widgets' ); /***********************************/ /************** HOOKS *************/ /***********************************/ /* Enables user customization via WordPress plugin API. */ require get_template_directory() . '/inc/hooks.php'; add_action( 'zerif_404_title', 'zerif_404_title_function' ); # Outputs the title on 404 pages add_action( 'zerif_404_content', 'zerif_404_content_function' ); # Outputs a helpful message on 404 pages add_action( 'zerif_page_header', 'zerif_page_header_function' ); # Outputs the title on pages add_action( 'zerif_page_header_title_archive', 'zerif_page_header_title_archive_function' ); # Outputs the title on archive pages add_action( 'zerif_page_term_description_archive', 'zerif_page_term_description_archive_function' ); # Outputs the term description add_action( 'zerif_footer_widgets', 'zerif_footer_widgets_function' ); #Outputs the 3 sidebars in footer add_action( 'zerif_our_focus_header_title', 'zerif_our_focus_header_title_function' ); #Outputs the title in Our focus section add_action( 'zerif_our_focus_header_subtitle', 'zerif_our_focus_header_subtitle_function' ); #Outputs the subtitle in Our focus section add_action( 'zerif_our_team_header_title', 'zerif_our_team_header_title_function' ); #Outputs the title in Our team section add_action( 'zerif_our_team_header_subtitle', 'zerif_our_team_header_subtitle_function' ); #Outputs the subtitle in Our team section add_action( 'zerif_testimonials_header_title', 'zerif_testimonials_header_title_function' ); #Outputs the title in Testimonials section add_action( 'zerif_testimonials_header_subtitle', 'zerif_testimonials_header_subtitle_function' ); #Outputs the subtitle in Testimonials section add_action( 'zerif_latest_news_header_title', 'zerif_latest_news_header_title_function' ); #Outputs the title in Latest news section add_action( 'zerif_latest_news_header_subtitle', 'zerif_latest_news_header_subtitle_function' ); #Outputs the subtitle in Latest news section add_action( 'zerif_big_title_text', 'zerif_big_title_text_function' ); #Outputs the text in Big title section add_action( 'zerif_about_us_header_title', 'zerif_about_us_header_title_function' ); #Outputs the title in About us section add_action( 'zerif_about_us_header_subtitle', 'zerif_about_us_header_subtitle_function' ); #Outputs the subtitle in About us section add_action( 'zerif_sidebar', 'zerif_sidebar_function' ); #Outputs the sidebar add_action( 'zerif_primary_navigation', 'zerif_primary_navigation_function' ); #Outputs the navigation menu add_filter( 'excerpt_more', 'zerif_excerpt_more' ); require_once( trailingslashit( get_template_directory() ) . 'inc/class/class-customizer-theme-info-control/class-customizer-theme-info-root.php' ); /** * About page class */ require_once get_template_directory() . '/ti-about-page/class-ti-about-page.php'; /* * About page instance */ $config = array( // Menu name under Appearance. 'menu_name' => __( 'About Zerif Lite', 'zerif-lite' ), // Page title. 'page_name' => __( 'About Zerif Lite', 'zerif-lite' ), // Main welcome title 'welcome_title' => sprintf( __( 'Welcome to %s! - Version ', 'zerif-lite' ), 'Zerif Lite' ), // Main welcome content 'welcome_content' => esc_html__( 'Zerif LITE is a free one page WordPress theme. It\'s perfect for web agency business,corporate business,personal and parallax business portfolio, photography sites and freelancer.Is built on BootStrap with parallax support, is responsive, clean, modern, flat and minimal. Zerif Lite is ecommerce (WooCommerce) Compatible, WPML, RTL, Retina-Ready, SEO Friendly and with parallax, full screen image is one of the best business themes.', 'zerif-lite' ), /** * Tabs array. * * The key needs to be ONLY consisted from letters and underscores. If we want to define outside the class a function to render the tab, * the will be the name of the function which will be used to render the tab content. */ 'tabs' => array( 'getting_started' => __( 'Getting Started', 'zerif-lite' ), 'recommended_actions' => __( 'Recommended Actions', 'zerif-lite' ), 'recommended_plugins' => __( 'Useful Plugins','zerif-lite' ), 'child_themes' => __( 'Child themes','zerif-lite' ), 'support' => __( 'Support', 'zerif-lite' ), 'changelog' => __( 'Changelog', 'zerif-lite' ), 'free_pro' => __( 'Free VS PRO', 'zerif-lite' ), ), // Support content tab. 'support_content' => array( 'first' => array ( 'title' => esc_html__( 'Contact Support','zerif-lite' ), 'icon' => 'dashicons dashicons-sos', 'text' => esc_html__( 'We offer excellent support through our advanced ticketing system. Make sure to register your purchase before contacting support!','zerif-lite' ), 'button_label' => esc_html__( 'Contact Support','zerif-lite' ), 'button_link' => esc_url( 'https://themeisle.com/contact/' ), 'is_button' => true, 'is_new_tab' => true ), 'second' => array( 'title' => esc_html__( 'Documentation','zerif-lite' ), 'icon' => 'dashicons dashicons-book-alt', 'text' => sprintf( esc_html__( 'This is the place to go to reference different aspects of the theme. Our online documentation is an incredible resource for learning the ins and outs of using %s.','zerif-lite' ), 'Zerif Lite' ), 'button_label' => esc_html__( 'See our full documentation','zerif-lite' ), 'button_link' => 'https://docs.themeisle.com/article/5-zerif-lite-documentation', 'is_button' => false, 'is_new_tab' => true ), 'third' => array( 'title' => esc_html__( 'Changelog','zerif-lite' ), 'icon' => 'dashicons dashicons-portfolio', 'text' => esc_html__( 'Want to get the gist on the latest theme changes? Just consult our changelog below to get a taste of the recent fixes and features implemented.','zerif-lite' ), 'button_label' => esc_html__( 'See changelog','zerif-lite' ), 'button_link' => esc_url( admin_url( 'themes.php?page=zerif-lite-welcome&tab=changelog&show=yes' ) ), 'is_button' => false, 'is_new_tab' => false ), 'fourth' => array( 'title' => esc_html__( 'Create a child theme','zerif-lite' ), 'icon' => 'dashicons dashicons-admin-customizer', 'text' => esc_html__( "If you want to make changes to the theme's files, those changes are likely to be overwritten when you next update the theme. In order to prevent that from happening, you need to create a child theme. For this, please follow the documentation below.",'zerif-lite' ), 'button_label' => esc_html__( 'View how to do this','zerif-lite' ), 'button_link' => 'https://docs.themeisle.com/article/14-how-to-create-a-child-theme', 'is_button' => false, 'is_new_tab' => true ), 'fifth' => array( 'title' => esc_html__( 'Speed up your site','zerif-lite' ), 'icon' => 'dashicons dashicons-controls-skipforward', 'text' => esc_html__( 'If you find yourself in the situation where everything on your site is running very slow, you might consider having a look at the below documentation where you will find the most common issues causing this and possible solutions for each of the issues.','zerif-lite' ), 'button_label' => esc_html__( 'View how to do this','zerif-lite' ), 'button_link' => 'https://docs.themeisle.com/article/63-speed-up-your-wordpress-site', 'is_button' => false, 'is_new_tab' => true ), 'sixth' => array( 'title' => esc_html__( 'Build a landing page with a drag-and-drop content builder','zerif-lite' ), 'icon' => 'dashicons dashicons-images-alt2', 'text' => esc_html__( 'In the below documentation you will find an easy way to build a great looking landing page using a drag-and-drop content builder plugin.','zerif-lite' ), 'button_label' => esc_html__( 'View how to do this','zerif-lite' ), 'button_link' => 'https://docs.themeisle.com/article/219-how-to-build-a-landing-page-with-a-drag-and-drop-content-builder', 'is_button' => false, 'is_new_tab' => true ) ), // Getting started tab 'getting_started' => array( 'first' => array ( 'title' => esc_html__( 'Step 1 - Implement recommended actions','zerif-lite' ), 'text' => esc_html__( 'We have compiled a list of steps for you, to take make sure the experience you will have using one of our products is very easy to follow.','zerif-lite' ), 'button_label' => esc_html__( 'Check recommended actions','zerif-lite' ), 'button_link' => esc_url( admin_url( 'themes.php?page=zerif-lite-welcome&tab=recommended_actions' ) ), 'is_button' => false, 'recommended_actions' => true, 'is_new_tab' => false ), 'second' => array( 'title' => esc_html__( 'Step 2 - Check our documentation','zerif-lite' ), 'text' => esc_html__( 'Even if you are a long-time WordPress user, we still believe you should give our documentation a very quick Read.','zerif-lite' ), 'button_label' => esc_html__( 'Full documentation','zerif-lite' ), 'button_link' => 'http://docs.themeisle.com/article/5-zerif-lite-documentation', 'is_button' => false, 'recommended_actions' => false, 'is_new_tab' => true ), 'third' => array( 'title' => esc_html__( 'Step 3 - Customize everything','zerif-lite' ), 'text' => esc_html__( 'Using the WordPress Customizer you can easily customize every aspect of the theme.','zerif-lite' ), 'button_label' => esc_html__( 'Go to Customizer','zerif-lite' ), 'button_link' => esc_url( admin_url( 'customize.php' ) ), 'is_button' => true, 'recommended_actions' => false, 'is_new_tab' => true ) ), // Child themes array. 'child_themes' => array( 'download_button_label' => 'Download', 'preview_button_label' => 'Live preview', 'content' => array( array( 'title' => 'ResponsiveBoat', 'image' => get_template_directory_uri() . '/images/responsiveboat.png', 'image_alt' => 'ResponsiveBoat', 'download_link' => 'https://wordpress.org/themes/responsiveboat/', 'preview_link' => 'https://wp-themes.com/responsiveboat/', ), array( 'title' => 'Zblackbeard', 'image' => get_template_directory_uri() . '/images/zblackbeard.png', 'image_alt' => 'Zblackbeard', 'download_link' => 'https://wordpress.org/themes/zblackbeard/', 'preview_link' => 'https://wp-themes.com/zblackbeard/', ), array( 'title' => 'OnePirate', 'image' => get_template_directory_uri() . '/images/onepirate.png', 'image_alt' => 'OnePirate', 'download_link' => 'https://wordpress.org/themes/onepirate/', 'preview_link' => 'https://wp-themes.com/onepirate/', ), array( 'title' => 'Zerius', 'image' => get_template_directory_uri() . '/images/zerius.png', 'image_alt' => 'Zerius', 'download_link' => 'https://wordpress.org/themes/zerius/', 'preview_link' => 'https://wp-themes.com/zerius/', ), array( 'title' => 'Zifer Child', 'image' => get_template_directory_uri() . '/images/zifer-child.png', 'image_alt' => 'Zifer Child', 'download_link' => 'https://wordpress.org/themes/zifer-child/', 'preview_link' => 'https://wp-themes.com/zifer-child/', ) ), ), // Free vs pro array. 'free_pro' => array( 'free_theme_name' => 'Zerif Lite', 'pro_theme_name' => 'Zerif PRO', 'pro_theme_link' => 'https://themeisle.com/themes/zerif-pro/', 'get_pro_theme_label' => sprintf( __( 'Get %s now!', 'zerif-lite' ), 'Zerif Pro' ), 'features' => array( array( 'title' => __( 'Parallax effect', 'zerif-lite' ), 'description' => __( 'Smooth, catchy and easy scrolling experience.', 'zerif-lite' ), 'is_in_lite' => 'true', 'is_in_pro' => 'true', ), array( 'title' => __( 'Mobile friendly', 'zerif-lite' ), 'description' => __( 'Responsive layout. Works on every device.', 'zerif-lite' ), 'is_in_lite' => 'true', 'is_in_pro' => 'true', ), array( 'title' => __( 'WooCommerce Compatible', 'zerif-lite' ), 'description' => __( 'Ready for e-commerce. You can build an online store here.', 'zerif-lite' ), 'is_in_lite' => 'true', 'is_in_pro' => 'true', ), array( 'title' => __( 'Frontpage sections', 'zerif-lite' ), 'description' => __( 'Big title, Our focus, About us, Our team, Testimonials, Ribbons, Latest news, Contat us', 'zerif-lite' ), 'is_in_lite' => 'true', 'is_in_pro' => 'true', ), array( 'title' => __( 'Background image', 'zerif-lite' ), 'description' => __( 'You can use any background image you want.', 'zerif-lite' ), 'is_in_lite' => 'true', 'is_in_pro' => 'true', ), array( 'title' => __( 'Unlimited color option', 'zerif-lite' ), 'description' => __( 'You can change the colors of each section. You have unlimited options.', 'zerif-lite' ), 'is_in_lite' => 'false', 'is_in_pro' => 'true', ), array( 'title' => __( 'Google map section', 'zerif-lite' ), 'description' => __( 'Embed your current location to your website by using a Google map.','zerif-lite' ), 'is_in_lite' => 'false', 'is_in_pro' => 'true', ), array( 'title' => __( 'Portfolio', 'zerif-lite' ), 'description' => __( 'Showcase your best projects in the portfolio section.', 'zerif-lite' ), 'is_in_lite' => 'false', 'is_in_pro' => 'true', ), array( 'title' => __( 'Sections order', 'zerif-lite' ), 'description' => __( 'Arrange the sections by your priorities.', 'zerif-lite' ), 'is_in_lite' => 'false', 'is_in_pro' => 'true', ), array( 'title' => __( 'Background slider/video', 'zerif-lite' ), 'description' => __( 'Apart from static images, you can use videos or sliders on the background.', 'zerif-lite' ), 'is_in_lite' => 'false', 'is_in_pro' => 'true', ), array( 'title' => __( 'Support', 'zerif-lite' ), 'description' => __( 'You will benefit of our full support for any issues you have with the theme.', 'zerif-lite' ), 'is_in_lite' => 'false', 'is_in_pro' => 'true', ), array( 'title' => __( 'Packages/Subscribe sections', 'zerif-lite' ), 'description' => __( 'Add pricing tables for your products and use newsletter forms to attract the clients.', 'zerif-lite' ), 'is_in_lite' => 'false', 'is_in_pro' => 'true', ), array( 'title' => __( 'Change labels for the Contact Us section', 'zerif-lite' ), 'description' => __( 'Write an original text in each Contact us section field.', 'zerif-lite' ), 'is_in_lite' => 'false', 'is_in_pro' => 'true', ), array( 'title' => __( 'No credit footer link', 'zerif-lite' ), 'description' => __( 'Remove "Zerif Lite powered by WordPress" copyright from the footer.', 'zerif-lite' ), 'is_in_lite' => 'false', 'is_in_pro' => 'true', ) ), ), // Plugins array. 'recommended_plugins' => array( 'already_activated_message' => esc_html__( 'Already activated', 'zerif-lite' ), 'version_label' => esc_html__( 'Version: ', 'zerif-lite' ), 'install_label' => esc_html__( 'Install', 'zerif-lite' ), 'activate_label' => esc_html__( 'Activate', 'zerif-lite' ), 'deactivate_label' => esc_html__( 'Deactivate', 'zerif-lite' ), 'content' => array( array( 'slug' => 'siteorigin-panels' ), array( 'slug' => 'wp-product-review' ), array( 'slug' => 'intergeo-maps' ), array( 'slug' => 'visualizer' ), array( 'slug' => 'adblock-notify-by-bweb' ), array( 'slug' => 'nivo-slider-lite' ) ), ), // Required actions array. 'recommended_actions' => array( 'install_label' => esc_html__( 'Install', 'zerif-lite' ), 'activate_label' => esc_html__( 'Activate', 'zerif-lite' ), 'deactivate_label' => esc_html__( 'Deactivate', 'zerif-lite' ), 'content' => array( 'themeisle-companion' => array( 'title' => __( 'ThemeIsle Companion', 'zerif-lite' ), 'description' => __( 'It is highly recommended that you install the companion plugin to have access to the frontpage sections widgets.', 'zerif-lite' ), 'link_label' => __( 'Install ThemeIsle Companion', 'zerif-lite' ), 'check' => defined( 'THEMEISLE_COMPANION_VERSION' ), 'plugin_slug' => 'themeisle-companion', 'id' => 'themeisle-companion' ), 'pirate-forms' => array( 'title' => __( 'Pirate Forms', 'zerif-lite' ), 'description' => __( 'Makes your contact page more engaging by creating a good-looking contact form on your website. The interaction with your visitors was never easier.', 'zerif-lite' ), 'link_label' => __( 'Install Pirate Forms', 'zerif-lite' ), 'check' => defined( 'PIRATE_FORMS_VERSION' ), 'plugin_slug' => 'pirate-forms', 'id' => 'pirate-forms' ), ), ), ); TI_About_Page::init( $config ); /* * Notifications in customize */ require get_template_directory() . '/ti-customizer-notify/class-ti-customizer-notify.php'; $config_customizer = array( 'recommended_plugins' => array( 'themeisle-companion' => array( 'recommended' => true, 'description' => sprintf( esc_html__( 'If you want to take full advantage of the options this theme has to offer, please install and activate %s','zerif-lite' ), sprintf( '%s', 'ThemeIsle Companion' ) ) ) ), 'recommended_actions' => array(), 'recommended_actions_title' => esc_html__( 'Recommended Actions', 'zerif-lite' ), 'recommended_plugins_title' => esc_html__( 'Recommended Plugins', 'zerif-lite' ), 'dismiss_button' => esc_html__( 'Dismiss', 'zerif-lite' ), 'install_button_label' => esc_html__( 'Install', 'zerif-lite' ), 'activate_button_label' => esc_html__( 'Activate', 'zerif-lite' ), 'deactivate_button_label' => esc_html__( 'Deactivate', 'zerif-lite' ) ); Ti_Customizer_Notify::init( $config_customizer ); } add_action('after_setup_theme', 'zerif_setup'); /* Migrate logo from theme to core */ function zerif_migrate_logo(){ $zerif_old_logo = get_theme_mod( 'zerif_logo' ); if ( ! empty( $zerif_old_logo ) ) { $zerif_old_logo_id = attachment_url_to_postid( $zerif_old_logo ); if ( is_int( $zerif_old_logo_id ) ) { set_theme_mod( 'custom_logo', $zerif_old_logo_id ); $zerif_migrated_logo = get_theme_mod( 'custom_logo' ); if ( ! empty( $zerif_migrated_logo ) ) { if ( $zerif_migrated_logo == $zerif_old_logo_id ) { remove_theme_mod( 'zerif_logo' ); } } } } } add_action( 'after_setup_theme', 'zerif_migrate_logo' ); function zerif_excerpt_more( $more ) { return ' ' . esc_html__('Read more about ', 'zerif-lite').esc_attr( get_the_title() ) . '[…]'; } function zerif_lite_is_not_latest_posts() { return ('posts' == get_option( 'show_on_front' ) ? true : false); } function zerif_lite_is_static_frontpage() { if ( 'posts' == get_option( 'show_on_front' ) ) { return false; } else { $frontpage_id = get_option( 'page_on_front' ); if ( 'template-frontpage.php' == get_post_meta( $frontpage_id, '_wp_page_template', true ) ) { return true; } else { return false; } } } /** * Register widgetized area and update sidebar with default widgets. */ function zerif_widgets_init() { register_sidebar(array( 'name' => __('Sidebar', 'zerif-lite'), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('About us section', 'zerif-lite'), 'id' => 'sidebar-aboutus', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebars( 3, array( 'name' => __('Footer area %d','zerif-lite'), 'id' => 'zerif-sidebar-footer', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' ) ); } add_action('widgets_init', 'zerif_widgets_init'); function zerif_slug_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Lora, translate this to 'off'. Do not translate * into your own language. */ $lato = _x( 'on', 'Lato font: on or off', 'zerif-lite' ); $homemade = _x( 'on', 'Homemade font: on or off', 'zerif-lite' ); /* Translators: If there are characters in your language that are not * supported by Open Sans, translate this to 'off'. Do not translate * into your own language. */ $monserrat = _x( 'on', 'Monserrat font: on or off', 'zerif-lite' ); $zerif_use_safe_font = get_theme_mod('zerif_use_safe_font'); if ( ( 'off' !== $lato || 'off' !== $monserrat || 'off' !== $homemade ) && isset($zerif_use_safe_font) && ($zerif_use_safe_font != 1) ) { $font_families = array(); if ( 'off' !== $lato ) { $font_families[] = 'Lato:300,400,700,400italic'; } if ( 'off' !== $monserrat ) { $font_families[] = 'Montserrat:400,700'; } if ( 'off' !== $homemade ) { $font_families[] = 'Homemade Apple'; } $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' ); } return $fonts_url; } /** * Enqueue scripts and styles. */ function zerif_scripts() { wp_enqueue_style( 'zerif_font', zerif_slug_fonts_url(), array(), null ); wp_enqueue_style( 'zerif_font_all', add_query_arg( array( 'family' => urlencode( 'Open Sans:300,300italic,400,400italic,600,600italic,700,700italic,800,800italic' ), 'subset' => urlencode( 'latin' ) ), "//fonts.googleapis.com/css" ) ); wp_enqueue_style( 'zerif_bootstrap_style', get_template_directory_uri() . '/css/bootstrap.css' ); wp_style_add_data( 'zerif_bootstrap_style', 'rtl', 'replace' ); wp_enqueue_style( 'zerif_fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), 'v1' ); wp_enqueue_style( 'zerif_style', get_stylesheet_uri(), array( 'zerif_fontawesome' ), 'v1' ); wp_enqueue_style( 'zerif_responsive_style', get_template_directory_uri() . '/css/responsive.css', array('zerif_style'), 'v1' ); wp_enqueue_style( 'zerif_ie_style', get_template_directory_uri() . '/css/ie.css', array('zerif_style'), 'v1' ); wp_style_add_data( 'zerif_ie_style', 'conditional', 'lt IE 9' ); if ( wp_is_mobile() ){ wp_enqueue_style( 'zerif_style_mobile', get_template_directory_uri() . '/css/style-mobile.css', array('zerif_bootstrap_style', 'zerif_style'),'v1' ); } /* Bootstrap script */ wp_enqueue_script( 'zerif_bootstrap_script', get_template_directory_uri() . '/js/bootstrap.min.js', array("jquery"), '20120206', true ); /* Knob script */ wp_enqueue_script( 'zerif_knob_nav', get_template_directory_uri() . '/js/jquery.knob.js', array("jquery"), '20120206', true ); /* Smootscroll script */ $zerif_disable_smooth_scroll = get_theme_mod( 'zerif_disable_smooth_scroll' ); if( isset( $zerif_disable_smooth_scroll ) && ( $zerif_disable_smooth_scroll != 1 ) ): wp_enqueue_script( 'zerif_smoothscroll', get_template_directory_uri() . '/js/smoothscroll.js', array("jquery"), '20120206', true ); endif; /* scrollReveal script */ if ( !wp_is_mobile() ){ wp_enqueue_script( 'zerif_scrollReveal_script', get_template_directory_uri() . '/js/scrollReveal.js', array("jquery"), '20120206', true ); } /* zerif script */ wp_enqueue_script( 'zerif_script', get_template_directory_uri() . '/js/zerif.js', array("jquery", "zerif_knob_nav"), '20120206', true ); if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } /* HTML5Shiv*/ wp_enqueue_script( 'zerif_html5', get_template_directory_uri() . '/js/html5.js'); wp_script_add_data( 'zerif_html5', 'conditional', 'lt IE 9' ); /* parallax effect */ if ( !wp_is_mobile() ){ /* include parallax only if on frontpage and the parallax effect is activated */ $zerif_parallax_use = get_theme_mod('zerif_parallax_show'); if ( !empty($zerif_parallax_use) && ($zerif_parallax_use == 1) && is_front_page() ): wp_enqueue_script( 'zerif_parallax', get_template_directory_uri() . '/js/parallax.js', array("jquery"), 'v1', true ); endif; } add_editor_style('/css/custom-editor-style.css'); } add_action('wp_enqueue_scripts', 'zerif_scripts'); /** * Adjust content width based on template. */ function zerif_adjust_content_width() { global $content_width; $zerif_change_to_full_width = get_theme_mod( 'zerif_change_to_full_width' ); if ( is_page_template( 'template-fullwidth.php' ) || is_page_template( 'template-fullwidth-no-title.php' ) || is_page_template( 'woocommerce.php' ) || is_page_template( 'single-download.php' ) || ( is_page_template( 'page.php' ) && !empty($zerif_change_to_full_width) ) ) $content_width = 1110; } add_action( 'template_redirect', 'zerif_adjust_content_width' ); /** * Remove Yoast rel="prev/next" link from header */ function zerif_remove_yoast_rel_link() { return false; } add_filter( 'wpseo_prev_rel_link', 'zerif_remove_yoast_rel_link' ); add_filter( 'wpseo_next_rel_link', 'zerif_remove_yoast_rel_link' ); add_action('tgmpa_register', 'zerif_register_required_plugins'); function zerif_register_required_plugins() { $wp_version_nr = get_bloginfo('version'); if( $wp_version_nr < 3.9 ): $plugins = array( array( 'name' => 'Widget customizer', 'slug' => 'widget-customizer', 'required' => false ), array( 'name' => 'Pirate Forms', 'slug' => 'pirate-forms', 'required' => false, ), array( 'name' => 'ThemeIsle Companion', 'slug' => 'themeisle-companion', 'required' => false, ) ); else: $plugins = array( array( 'name' => 'Pirate Forms', 'slug' => 'pirate-forms', 'required' => false, ), array( 'name' => 'ThemeIsle Companion', 'slug' => 'themeisle-companion', 'required' => false, ) ); endif; $config = array( 'default_path' => '', 'menu' => 'tgmpa-install-plugins', 'has_notices' => true, 'dismissable' => true, 'dismiss_msg' => '', 'is_automatic' => false, 'message' => '', 'strings' => array( 'page_title' => __('Install Required Plugins', 'zerif-lite'), 'menu_title' => __('Install Plugins', 'zerif-lite'), 'installing' => __('Installing Plugin: %s', 'zerif-lite'), 'oops' => __('Something went wrong with the plugin API.', 'zerif-lite'), 'notice_can_install_required' => _n_noop('This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.','zerif-lite'), 'notice_can_install_recommended' => _n_noop('This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.','zerif-lite'), 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.','zerif-lite'), 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.','zerif-lite'), 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.','zerif-lite'), 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.','zerif-lite'), 'notice_ask_to_update' => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.','zerif-lite'), 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.','zerif-lite'), 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins','zerif-lite'), 'activate_link' => _n_noop('Begin activating plugin', 'Begin activating plugins','zerif-lite'), 'return' => __('Return to Required Plugins Installer', 'zerif-lite'), 'plugin_activated' => __('Plugin activated successfully.', 'zerif-lite'), 'complete' => __('All plugins installed and activated successfully. %s', 'zerif-lite'), 'nag_type' => 'updated' ) ); tgmpa($plugins, $config); } /* Load Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php'; function zerif_wp_page_menu() { echo ''; } add_filter('the_title', 'zerif_default_title'); function zerif_default_title($title) { if ($title == '') $title = __("Default title",'zerif-lite'); return $title; } /*****************************************/ /****** WIDGETS *************/ /*****************************************/ add_action('widgets_init', 'zerif_register_widgets'); function zerif_register_widgets() { if ( !defined("THEMEISLE_COMPANION_VERSION") ) { if ( zerif_check_if_old_version_of_theme() ) { register_widget( 'zerif_ourfocus' ); register_widget( 'zerif_testimonial_widget' ); register_widget( 'zerif_clients_widget' ); register_widget( 'zerif_team_widget' ); } } $zerif_lite_sidebars = array ( 'sidebar-ourfocus' => 'sidebar-ourfocus', 'sidebar-testimonials' => 'sidebar-testimonials', 'sidebar-ourteam' => 'sidebar-ourteam' ); /* Register sidebars */ foreach ( $zerif_lite_sidebars as $zerif_lite_sidebar ): $extra_class = ''; if( $zerif_lite_sidebar == 'sidebar-ourfocus' ): $zerif_lite_name = __('Our focus section widgets', 'zerif-lite'); elseif( $zerif_lite_sidebar == 'sidebar-testimonials' ): $extra_class = 'feedback-box'; $zerif_lite_name = __('Testimonials section widgets', 'zerif-lite'); elseif( $zerif_lite_sidebar == 'sidebar-ourteam' ): $zerif_lite_name = __('Our team section widgets', 'zerif-lite'); else: $zerif_lite_name = $zerif_lite_sidebar; endif; register_sidebar( array ( 'name' => $zerif_lite_name, 'id' => $zerif_lite_sidebar, 'before_widget' => '', 'after_widget' => '', ) ); endforeach; } /**************************/ /****** our focus widget */ /************************/ if ( !class_exists( 'zerif_ourfocus' ) && zerif_check_if_old_version_of_theme() ) { class zerif_ourfocus extends WP_Widget { public function __construct() { parent::__construct( 'ctUp-ads-widget', __( 'Zerif - Our focus widget', 'zerif-lite' ), array( 'customize_selective_refresh' => true, ) ); add_action( 'admin_enqueue_scripts', array( $this, 'widget_scripts' ) ); } function widget_scripts( $hook ) { if ( $hook != 'widgets.php' ) { return; } wp_enqueue_media(); wp_enqueue_script( 'zerif_widget_media_script', get_template_directory_uri() . '/js/widget-media.js', false, '1.1', true ); } function widget( $args, $instance ) { extract( $args ); echo $before_widget; ?>

'; echo htmlspecialchars_decode( apply_filters( 'widget_title', $instance['text'] ) ); echo '

'; } ?>
true, ) ); add_action( 'admin_enqueue_scripts', array( $this, 'widget_scripts' ) ); } function widget_scripts( $hook ) { if ( $hook != 'widgets.php' ) { return; } wp_enqueue_media(); wp_enqueue_script( 'zerif_widget_media_script', get_template_directory_uri() . '/js/widget-media.js', false, '1.1', true ); } function widget( $args, $instance ) { extract( $args ); $zerif_accessibility = get_theme_mod( 'zerif_accessibility' ); // open link in a new tab when checkbox "accessibility" is not ticked $attribut_new_tab = ( isset( $zerif_accessibility ) && ( $zerif_accessibility != 1 ) ? ' target="_blank"' : '' ); echo $before_widget; ?>
class="client-name" >
'; echo ''; echo '
'; } elseif ( ! empty( $instance['custom_media_id'] ) ) { $zerif_testimonials_custom_media_id = wp_get_attachment_image_url( $instance["custom_media_id"] ); $alt = get_post_meta( $instance['custom_media_id'], '_wp_attachment_image_alt', true ); if ( ! empty( $zerif_testimonials_custom_media_id ) ) { echo ''; } } ?>






get_field_name( 'image_in_customizer' ); ?> <?php echo __( 'Uploaded image', 'zerif-lite' ); ?>

"/> true, ) ); add_action( 'admin_enqueue_scripts', array( $this, 'widget_scripts' ) ); } function widget_scripts( $hook ) { if ( $hook != 'widgets.php' ) { return; } wp_enqueue_media(); wp_enqueue_script( 'zerif_widget_media_script', get_template_directory_uri() . '/js/widget-media.js', false, '1.1', true ); } function widget( $args, $instance ) { extract( $args ); echo $before_widget; ?> '; } elseif ( ! empty( $instance['custom_media_id'] ) ) { $zerif_clients_custom_media_id = wp_get_attachment_image_url( $instance["custom_media_id"] ); if ( ! empty( $zerif_clients_custom_media_id ) ) { echo '' . __( 'Client', 'zerif-lite' ) . ''; } } ?>



get_field_name( 'image_in_customizer' ); ?> <?php echo __( 'Uploaded image', 'zerif-lite' ); ?>

"/> true, ) ); add_action( 'admin_enqueue_scripts', array( $this, 'widget_scripts' ) ); } function widget_scripts( $hook ) { if ( $hook != 'widgets.php' ) { return; } wp_enqueue_media(); wp_enqueue_script( 'zerif_widget_media_script', get_template_directory_uri() . '/js/widget-media.js', false, '1.1', true ); } function widget( $args, $instance ) { extract( $args ); echo $before_widget; ?>
<?php echo esc_attr( $alt ); ?>









>


get_field_name( 'image_in_customizer' ); ?> <?php echo __( 'Uploaded image', 'zerif-lite' ); ?>

"/>