tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'menu-1' => esc_html__( 'Primary', 'app' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'app_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_editor_style( array( 'css/editor-style.css' ) );
// Indicate widget sidebars can use selective refresh in the Customizer.
add_theme_support( 'customize-selective-refresh-widgets' );
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support( 'custom-logo', array(
'height' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
) );
}
endif;
add_action( 'after_setup_theme', 'app_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function app_content_width() {
$GLOBALS['content_width'] = apply_filters( 'app_content_width', 640 );
}
add_action( 'after_setup_theme', 'app_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function app_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'app' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'app' ),
'before_widget' => '',
'before_title' => '
',
) );
}
add_action( 'widgets_init', 'app_widgets_init' );
function app_customize_register( $wp_customize ) {
// Do stuff with $wp_customize, the WP_Customize_Manager object.
/* Banner layout */
$wp_customize->add_panel( 'theme_setting', array(
'priority' => 10,
'capability' => 'edit_theme_options',
'title' => __('Theme setting', 'app'),
) );
$wp_customize->add_section(
'banner_section',
array(
'title' => __('Banner layout','app'),
'panel' => 'theme_setting',)
);
$wp_customize->add_setting( 'banner_section_title', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'App'
));
$wp_customize->add_control( 'banner_section_title', array(
'label' => __( 'Title', 'app' ),
'type' => 'text',
'section' => 'banner_section'
));
$wp_customize->add_setting( 'banner_section_btn_label', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'DOWNLOAD'
));
$wp_customize->add_control( 'banner_section_btn_label', array(
'label' => __( 'Button text', 'app' ),
'type' => 'text',
'section' => 'banner_section'
));
$wp_customize->add_setting( 'banner_section_btn_url', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => '#'
));
$wp_customize->add_control( 'banner_section_btn_url', array(
'label' => __( 'Buton URL', 'app' ),
'type' => 'text',
'section' => 'banner_section'
));
$wp_customize->add_setting( 'banner_section_text', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Start downloading from the mobile application you expected'
));
$wp_customize->add_control( 'banner_section_text', array(
'label' => __( 'Statement', 'app' ),
'type' => 'text',
'section' => 'banner_section'
));
$wp_customize->add_setting( 'banner_section_btn_url_1', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => '#'
));
$wp_customize->add_control( 'banner_section_btn_url_1', array(
'label' => __( '1 . Buton URL', 'app' ),
'type' => 'text',
'section' => 'banner_section'
));
$wp_customize->add_setting( 'banner_section_btn_url_2', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => '#'
));
$wp_customize->add_control( 'banner_section_btn_url_2', array(
'label' => __( '2 . Buton URL', 'app' ),
'type' => 'text',
'section' => 'banner_section'
));
$wp_customize->add_setting( 'banner_section_img', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'type' => 'theme_mod'
));
$wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'banner_section_img', array(
'label' => __( 'Picture', 'app' ),
'description' => __( 'Your images must be at 430x500', 'app' ),
'type' => 'media',
'mime_type' => 'image',
'section' => 'banner_section'
) ) );
/* Feature Layouts 1 */
$wp_customize->add_section(
'feature1_section',
array(
'title' => __('Feature Layouts 1','app'),
'panel' => 'theme_setting',)
);
$wp_customize->add_setting( 'feature1_section_title', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Easy, but powerful'
));
$wp_customize->add_control( 'feature1_section_title', array(
'label' => __( 'Title', 'app' ),
'type' => 'text',
'section' => 'feature1_section'
));
$wp_customize->add_setting( 'feature1_section_textarea', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.'
));
$wp_customize->add_control( 'feature1_section_textarea', array(
'label' => __( 'Statement', 'app' ),
'type' => 'textarea',
'section' => 'feature1_section'
));
$wp_customize->add_setting( 'feature1_section_btn_label', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'DOWNLOAD'
));
$wp_customize->add_control( 'feature1_section_btn_label', array(
'label' => __( 'Button text', 'app' ),
'type' => 'text',
'section' => 'feature1_section'
));
$wp_customize->add_setting( 'feature1_section_btn_url', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => '#'
));
$wp_customize->add_control( 'feature1_section_btn_url', array(
'label' => __( 'Buton URL', 'app' ),
'type' => 'text',
'section' => 'feature1_section'
));
$wp_customize->add_setting( 'feature1_section_img', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'type' => 'theme_mod'
));
$wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'feature1_section_img', array(
'label' => __( 'Picture', 'app' ),
'description' => __( 'Your images must be at 250x600', 'app' ),
'type' => 'media',
'mime_type' => 'image',
'section' => 'feature1_section'
) ) );
/* Feature Layouts 2 */
$wp_customize->add_section(
'feature2_section',
array(
'title' => __('Feature Layouts 2','app'),
'panel' => 'theme_setting',)
);
$wp_customize->add_setting( 'feature2_section_title', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Works everywhere'
));
$wp_customize->add_control( 'feature2_section_title', array(
'label' => __( 'Title', 'app' ),
'type' => 'text',
'section' => 'feature2_section'
));
$wp_customize->add_setting( 'feature2_section_textarea', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.'
));
$wp_customize->add_control( 'feature2_section_textarea', array(
'label' => __( 'Statement', 'app' ),
'type' => 'textarea',
'section' => 'feature2_section'
));
$wp_customize->add_setting( 'feature2_section_btn_label_1', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'DOWNLOAD'
));
$wp_customize->add_control( 'feature2_section_btn_label_1', array(
'label' => __( 'Button text', 'app' ),
'type' => 'text',
'section' => 'feature2_section'
));
$wp_customize->add_setting( 'feature2_section_btn_url_1', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => '#'
));
$wp_customize->add_control( 'feature2_section_btn_url_1', array(
'label' => __( 'Buton URL', 'app' ),
'type' => 'text',
'section' => 'feature2_section'
));
$wp_customize->add_setting( 'feature2_section_img', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'type' => 'theme_mod'
));
$wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'feature2_section_img', array(
'label' => __( 'Picture ', 'app' ),
'description' => __( 'Your images must be at 1200x970', 'app' ),
'type' => 'media',
'mime_type' => 'image',
'section' => 'feature2_section'
) ) );
/* Subarea Layout */
$wp_customize->add_section(
'bottom_section',
array(
'title' => __('Subarea Layout','app'),
'panel' => 'theme_setting',)
);
$wp_customize->add_setting( 'bottom_section_img', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'type' => 'theme_mod'
));
$wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'bottom_section_img', array(
'label' => __( 'Picture ', 'app' ),
'description' => __( 'Your pictures must be in 550x370', 'app' ),
'type' => 'media',
'mime_type' => 'image',
'section' => 'bottom_section'
) ) );
$wp_customize->add_setting( 'bottom_section_title', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'app'
));
$wp_customize->add_control( 'bottom_section_title', array(
'label' => __( 'Title', 'app' ),
'type' => 'text',
'section' => 'bottom_section'
));
$wp_customize->add_setting( 'bottom_section_text', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Get your mobile phone now'
));
$wp_customize->add_control( 'bottom_section_text', array(
'label' => __( 'Statement', 'app' ),
'type' => 'text',
'section' => 'bottom_section'
));
$wp_customize->add_setting( 'bottom_section_btn_url_1', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => '#'
));
$wp_customize->add_control( 'bottom_section_btn_url_1', array(
'label' => __( '1 . Button URL', 'app' ),
'type' => 'text',
'section' => 'bottom_section'
));
$wp_customize->add_setting( 'bottom_section_btn_url_2', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => '#'
));
$wp_customize->add_control( 'bottom_section_btn_url_2', array(
'label' => __( '2 . Button URL', 'app' ),
'type' => 'text',
'section' => 'bottom_section'
));
/* Social Connections */
$wp_customize->add_section(
'footer_section',
array(
'title' => __('Social Connections','app'),
'panel' => 'theme_setting',)
);
$wp_customize->add_setting( 'footer_section_textarea', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Get support to take advantage of our uninterrupted services
SUPPORT'
));
$wp_customize->add_control( 'footer_section_textarea', array(
'label' => __( 'Knowledge area', 'app' ),
'type' => 'textarea',
'section' => 'footer_section'
));
$wp_customize->add_setting( 'footer_section_facebook_url', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => '#'
));
$wp_customize->add_control( 'footer_section_facebook_url', array(
'label' => __( 'Facebook URL', 'app' ),
'type' => 'text',
'section' => 'footer_section'
));
$wp_customize->add_setting( 'footer_section_twitter_url', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => '#'
));
$wp_customize->add_control( 'footer_section_twitter_url', array(
'label' => __( 'Twitter URL', 'app' ),
'type' => 'text',
'section' => 'footer_section'
));
$wp_customize->add_setting( 'footer_section_instagram_url', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => '#'
));
$wp_customize->add_control( 'footer_section_instagram_url', array(
'label' => __( 'Instagram URL', 'app' ),
'type' => 'text',
'section' => 'footer_section'
));
/* Copyright */
$wp_customize->add_section(
'copyright_section',
array(
'title' => __('Copyright','app'),
'panel' => 'theme_setting',)
);
$wp_customize->add_setting( 'copyright_section_text', array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Copyright 2017 - All Rights Reserved'
));
$wp_customize->add_control( 'copyright_section_text', array(
'label' => __( 'Copyright', 'app' ),
'type' => 'textarea',
'section' => 'copyright_section'
));
}
add_action( 'customize_register', 'app_customize_register' );
/**
* Enqueue scripts and styles.
*/
function app_scripts() {
/*Js*/
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/jquery-3.2.1.min.js', false, null, true);
wp_enqueue_script( 'tether', 'https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js', false, null, true);
wp_enqueue_script( 'bootstrapalpha', 'https://pingendo.com/assets/bootstrap/bootstrap-4.0.0-alpha.6.min.js', false, null, true);
wp_enqueue_script( 'smoothscroll', 'https://pingendo.com/assets/scripts/smooth-scroll.js', false, null, true);
/*Style*/
wp_enqueue_style( 'app-style', get_stylesheet_uri() );
wp_enqueue_style( 'bootstrap', get_theme_file_uri( '/css/theme.css' ), array( 'app-style' ), '1.1' );
wp_enqueue_style( 'fontawesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', false, null, 'all');
wp_enqueue_script( 'app-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true );
wp_enqueue_script( 'app-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'app_scripts' );
/**
* Wp_bootstrap_navwalker.
*/
require_once "inc/bootstrap/wp_bootstrap_navwalker.php";
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Implement the Customizer feature.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Functions which enhance the theme by hooking into WordPress.
*/
require get_template_directory() . '/inc/template-functions.php';