__('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. */
add_theme_support('custom-background', apply_filters('zerif_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => get_stylesheet_directory_uri() . "/images/bg.jpg",
)));
/* 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' );
/* 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' );
/*******************************************/
/************* Welcome screen *************/
/*******************************************/
if ( is_admin() ) {
global $zerif_required_actions;
/*
* id - unique id; required
* title
* description
* check - check for plugins (if installed)
* plugin_slug - the plugin's slug (used for installing the plugin)
*
*/
$zerif_required_actions = array(
array(
"id" => 'zerif-lite-req-ac-frontpage-latest-news',
"title" => esc_html__( 'Get the one page template' ,'zerif-lite' ),
"description"=> esc_html__( 'If you just installed Zerif Lite, and are not able to see the one page template, you need to go to Settings -> Reading , Front page displays and select "Your latest posts".','zerif-lite' ),
"check" => zerif_lite_is_not_latest_posts()
),
array(
"id" => 'zerif-lite-req-ac-install-pirate-forms',
"title" => esc_html__( 'Install Pirate Forms' ,'zerif-lite' ),
"description"=> esc_html__( 'In the next updates, Zerif Lite\'s default contact form will be removed. Please make sure you install the Pirate Forms plugin to keep your site updated, and experience a smooth transition to the latest version.','zerif-lite' ),
"check" => defined("PIRATE_FORMS_VERSION"),
"plugin_slug" => 'pirate-forms'
),
array(
"id" => 'zerif-lite-req-ac-check-pirate-forms',
"title" => esc_html__( 'Check the contact form after installing Pirate Forms' ,'zerif-lite' ),
"description"=> esc_html__( "After installing the Pirate Forms plugin, please make sure you check your frontpage contact form is working fine. Also, if you use Zerif Lite in other language(s) please make sure the translation is ok. If not, please translate the contact form again.",'zerif-lite' ),
)
);
require get_template_directory() . '/inc/admin/welcome-screen/welcome-screen.php';
}
}
add_action('after_setup_theme', 'zerif_setup');
function zerif_lite_is_not_latest_posts() {
return ('posts' == get_option( 'show_on_front' ) ? true : 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' => '
'
)
);
}
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' );
if ( 'off' !== $lato || 'off' !== $monserrat|| 'off' !== $homemade ) {
$font_families = array();
if ( 'off' !== $lato ) {
$font_families[] = 'Lato:300,400,700,400italic';
}
if ( 'off' !== $monserrat ) {
$font_families[] = 'Montserrat: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', '//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600italic,600,700,700italic,800,800italic');
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_pixeden_style', get_template_directory_uri() . '/css/pixeden-icons.css', array('zerif_fontawesome'), 'v1');
wp_enqueue_style('zerif_style', get_stylesheet_uri(), array('zerif_pixeden_style'), 'v1');
wp_enqueue_style('zerif_responsive_style', get_template_directory_uri() . '/css/responsive.css', array('zerif_style'), 'v1');
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' );
}
wp_enqueue_script('jquery');
/* Bootstrap script */
wp_enqueue_script('zerif_bootstrap_script', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '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');
}
/* 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');
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,
)
);
else:
$plugins = array(
array(
'name' => 'Pirate Forms',
'slug' => 'pirate-forms',
'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 '