tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); add_theme_support( "responsive-embeds" ); add_theme_support( "wp-block-styles" ); add_theme_support( "align-wide" ); /* * 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' ); add_theme_support( "wp-block-styles" ); add_theme_support( "responsive-embeds" ); add_theme_support( "align-wide" ); add_theme_support('custom-line-height'); add_theme_support('custom-spacing'); add_theme_support('custom-units'); /** * Enable support for post formats * * @link https://developer.wordpress.org/themes/functionality/post-formats/ */ add_theme_support( 'post-formats', array( 'gallery', 'quote', 'audio', 'image', 'video' ) ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'menu-1' => esc_html__( 'Primary Menu', 'appzend' ), ) ); /* * 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', 'style', 'script', ) ); /** * Registers an editor stylesheet for the theme. */ function appzend_theme_add_editor_styles() { add_editor_style( 'appzend-editor-style.css' ); } add_action( 'admin_init', 'appzend_theme_add_editor_styles' ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'appzend_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. 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', 'appzend_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 appzend_content_width() { $GLOBALS['content_width'] = apply_filters( 'appzend_content_width', 640 ); } add_action( 'after_setup_theme', 'appzend_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function appzend_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Right Sidebar Widget Area', 'appzend' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'appzend' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar( array( 'name' => esc_html__( 'Left Sidebar Widget Area', 'appzend' ), 'id' => 'sidebar-2', 'description' => esc_html__( 'Add widgets here.', 'appzend' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar( array( 'name' => esc_html__( 'Footer Widget Area', 'appzend' ), 'id' => 'footer-1', 'description' => esc_html__( 'Add widgets here.', 'appzend' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action( 'widgets_init', 'appzend_widgets_init' ); if ( ! function_exists( 'appzend_fonts_url' ) ) : /** * Register Google fonts for appzend * * Create your own appzend_fonts_url() function to override in a child theme. * * @since appzend 1.0.0 * * @return string Google fonts URL for the theme. */ function appzend_fonts_url() { $fonts_url = ''; $font_families = array(); if ( 'off' !== _x( 'on', 'Montserrat: on or off', 'appzend' ) ) { $font_families[] = 'Montserrat:wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,900'; } if ( 'off' !== _x( 'on', 'Livvic: on or off', 'appzend' ) ) { $font_families[] = 'Livvic:wght@100;0,200;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,900'; } if( $font_families ) { $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return esc_url ( $fonts_url ); } endif; /** * Enqueue scripts and styles. */ function appzend_scripts() { $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_style( 'owl-carousel', get_template_directory_uri(). '/assets/library/owlcarousel/css/owl.carousel' . esc_attr( $min ) . '.css'); wp_enqueue_script( 'owl-carousel', get_template_directory_uri() . '/assets/library/owlcarousel/js/owl.carousel' . esc_attr ( $min ) . '.js', array('jquery'),'2.3.4', true ); wp_enqueue_style( 'appzend-fonts', appzend_fonts_url(), array(), null ); wp_enqueue_style( 'fontawesome-4-5', get_template_directory_uri(). '/assets/library/fontawesome/css/all' . esc_attr( $min ) . '.css'); wp_enqueue_style( 'appzend-style', get_stylesheet_uri(), array(), _S_VERSION ); if (class_exists('woocommerce') && get_theme_mod('appzend_producthotoffer_section', 'disable') == 'enable') { /* Countdown */ wp_enqueue_script('jquery-countdown', get_template_directory_uri() . '/assets/js/jquery.countdown.js', array('jquery'), true); } wp_enqueue_script( 'appzend-custom', get_template_directory_uri() . '/assets/js/appzend-custom.js', array(), _S_VERSION, true ); wp_localize_script( 'appzend-custom', 'appzend_tabs_ajax_action', array( 'ajaxurl' => admin_url( 'admin-ajax.php') ) ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'appzend_scripts' ); /** * Admin Enqueue scripts and styles. */ if ( ! function_exists( 'appzend_admin_scripts' ) ) { function appzend_admin_scripts( $hook ) { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'wp-color-picker' ); if( $hook != 'edit.php' && $hook != 'post.php' && $hook != 'post-new.php' && 'widgets.php' != $hook ) return; wp_enqueue_script( 'wp-color-picker-alpha', get_template_directory_uri() . '/assets/js/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), '3.0.0', true ); wp_enqueue_style( 'appzend-admin-style', get_template_directory_uri() . '/assets/css/appzend-admin.css'); } } add_action('admin_enqueue_scripts', 'appzend_admin_scripts'); /** * Sets the Appzend Template Instead of front-page. */ function appzend_front_page_set( $template ) { $appzend_front_page = get_theme_mod( 'appzend_enable_frontpage', 'disable'); if( 'enable' != $appzend_front_page ){ if ( 'posts' == get_option( 'show_on_front' ) ) { include( get_home_template() ); } else { include( get_page_template() ); } } } add_filter( 'appzend_enable_front_page', 'appzend_front_page_set' ); /** * Load Other Files. */ require get_template_directory() . '/inc/init.php'; if ( ! function_exists( 'appzend_admin_scripts_2' ) ) { function appzend_admin_scripts_2() { wp_enqueue_script( 'appzend-admin-script', get_template_directory_uri() . '/assets/js/admin-custom.js'); } } add_action('admin_enqueue_scripts', 'appzend_admin_scripts_2'); /** remove widgets block editor */ function appzend_widget_theme_support() { remove_theme_support( 'widgets-block-editor' ); } //add_action( 'after_setup_theme', 'appzend_widget_theme_support' ); /** * Registers block patterns and categories. * * @since Appzend 1.2.1 * * @return void */ if(!function_exists('appzend_register_block_patterns')){ function appzend_register_block_patterns() { $patterns = array(); $block_pattern_categories = array( 'appzend' => array( 'label' => __( 'Appzend Themes', 'appzend' ) ) ); $block_pattern_categories = apply_filters( 'appzend_register_block_patterns', $block_pattern_categories ); foreach ( $block_pattern_categories as $name => $properties ) { if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) { register_block_pattern_category( $name, $properties ); } } register_block_style( 'core/list', array( 'name' => 'checkmark-list', 'label' => __( 'Check Mark', 'appzend' ), /* * Styles for the custom checkmark list block style * https://github.com/WordPress/gutenberg/issues/51480 */ 'inline_style' => ' .is-style-checkmark-list .block-editor-block-list__block{ display: flex; align-items: center; } .is-style-checkmark-list .block-editor-block-list__block:before{ color: var(--wp--preset--color--primary); } .editor-styles-wrapper ol.is-style-checkmark-list, .editor-styles-wrapper ul.is-style-checkmark-list, ol.is-style-checkmark-list, ul.is-style-checkmark-list{ padding: 0; } .is-style-checkmark-list li{ margin-bottom: 5px; list-style: none; display: flex; align-items: center; } .is-style-checkmark-list li a{ margin-left: 3px; } .is-style-checkmark-list li:before { content: "\f12a"; font-family: "dashicons"; color: #ff7101; margin-right: 5px; }', ) ); register_block_style( 'core/list', array( 'name' => 'circle-list', 'label' => __( 'Circle List', 'appzend' ), /* * Styles for the custom circle list block style * https://github.com/WordPress/gutenberg/issues/51480 */ 'inline_style' => ' .is-style-circle-list .block-editor-block-list__block{ display: flex; align-items: center; } .is-style-circle-list .block-editor-block-list__block:before{ color: var(--wp--preset--color--primary); } .editor-styles-wrapper ol.is-style-circle-list, .editor-styles-wrapper ul.is-style-circle-list, ol.is-style-circle-list, ul.is-style-circle-list{ padding: 0; } .is-style-circle-list li{ margin-bottom: 5px; list-style: none; display: flex; align-items: center; } .is-style-circle-list li a{ margin-left: 3px; } .is-style-circle-list li:before { content: "\f159"; font-family: "dashicons"; color: #ff7101; margin-right: 5px; }', ) ); /** Button */ register_block_style( 'core/button', array( 'name' => 'primary-button', 'label' => esc_html__( 'Primary Button', 'appzend' ), 'inline_style' => ' .wp-block-button .wp-block-button__link.is-style-outline, .wp-block-button.is-style-outline>.wp-block-button__link { padding: 20px 32px; cursor: pointer; } .wp-block-button .wp-block-button__link.is-style-outline:not(.has-text-color), .wp-block-button.is-style-outline>.wp-block-button__link:not(.has-text-color){ color: var(--wp--preset--color--primary); } .wp-block-button.is-style-primary-button .wp-block-button__link, .editor-styles-wrapper .is-style-primary-button.wp-block-button .wp-block-button__link { overflow: hidden; position: relative; z-index: 1; vertical-align: middle; padding-right:55px; cursor: pointer; } .is-style-primary-button .wp-block-button__link::after { content: "\f344"; position: absolute; margin-left: 5px; font-family: "dashicons"; } .wp-block-button.is-style-primary-button .wp-block-button__link:before, .editor-styles-wrapper .is-style-primary-button.wp-block-button .wp-block-button__link:before { content: ""; position: absolute; z-index: -1; background-color: var(--wp--preset--color--black); left: auto; right: 0; top: 0; height: 100%; width: 0; -webkit-transition: all ease 0.4s; -o-transition: all ease 0.4s; transition: all ease 0.4s; } .wp-block-button.is-style-primary-button .wp-block-button__link:hover, .editor-styles-wrapper .is-style-primary-button.wp-block-button .wp-block-button__link:hover { color: var(--wp--preset--color--white); } .wp-block-button.is-style-primary-button .wp-block-button__link:hover:before, .editor-styles-wrapper .is-style-primary-button.wp-block-button .wp-block-button__link:hover:before { width: 101%; right: auto; left: 0; }', ) ); register_block_style( 'core/button', array( 'name' => 'secondary-button', 'label' => esc_html__( 'Secondary Button', 'appzend' ), 'inline_style' => ' .wp-block-button.is-style-secondary-button .wp-block-button__link, .editor-styles-wrapper .is-style-secondary-button.wp-block-button .wp-block-button__link { overflow: hidden; position: relative; z-index: 1; vertical-align: middle; padding-right:55px; cursor: pointer; background-color: var(--wp--preset--color--white); color: var(--wp--preset--color--primary); border: 2px solid var(--wp--preset--color--primary); padding: 18px 55px 18px 30px; } .is-style-secondary-button .wp-block-button__link::after { content: "\f344"; position: absolute; margin-left: 5px; font-family: "dashicons"; } .wp-block-button.is-style-secondary-button .wp-block-button__link:before, .editor-styles-wrapper .is-style-secondary-button.wp-block-button .wp-block-button__link:before { content: ""; position: absolute; z-index: -1; background-color: var(--wp--preset--color--primary); left: auto; right: 0; top: 0; height: 100%; width: 0; -webkit-transition: all ease 0.4s; -o-transition: all ease 0.4s; transition: all ease 0.4s; } .wp-block-button.is-style-secondary-button .wp-block-button__link:hover, .editor-styles-wrapper .is-style-secondary-button.wp-block-button .wp-block-button__link:hover { color: var(--wp--preset--color--white); } .wp-block-button.is-style-secondary-button .wp-block-button__link:hover:before, .editor-styles-wrapper .is-style-secondary-button.wp-block-button .wp-block-button__link:hover:before { width: 101%; right: auto; left: 0; }', ) ); register_block_style( 'core/button', array( 'name' => 'no-border', 'label' => esc_html__( 'No Border', 'appzend' ), 'inline_style' => ' .wp-block-button.is-style-no-border .wp-block-button__link, .editor-styles-wrapper .is-style-no-border.wp-block-button .wp-block-button__link { overflow: hidden; position: relative; z-index: 1; vertical-align: middle; cursor: pointer; background-color: transparent; color: var(--wp--preset--color--black); padding: 0 25px 0 0; } .is-style-no-border .wp-block-button__link::after { content: "\f344"; position: absolute; margin-left: 5px; font-family: "dashicons"; } .wp-block-button.is-style-no-border .wp-block-button__link:hover, .editor-styles-wrapper .is-style-no-border.wp-block-button .wp-block-button__link:hover { color: var(--wp--preset--color--primary); }', ) ); register_block_style( 'core/button', array( 'name' => 'video', 'control__label' => 'shiv', 'label' => esc_html__( 'Video Icon', 'appzend' ), 'inline_style' => ' .wp-block-button.is-style-video .wp-block-button__link, .editor-styles-wrapper .is-style-video.wp-block-button .wp-block-button__link { position: relative; z-index: 99; width: 65px; height: 65px; font-size: 25px; color: var(--wp--preset--color--white); text-align: center; background: var(--wp--preset--color--primary); border-radius: 50%; font-size:0; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 16px rgba(19, 143, 129, 0.9); } .is-style-video .wp-block-button__link::before { position: absolute; content: ""; top: -2px; bottom: -2px; left: -2px; right: -2px; border-radius: 50%; box-shadow: 0 0 rgba(255, 255, 255, 0.2), 0 0 0 16px rgba(255, 255, 255, 0.2), 0 0 0 32px rgba(255, 255, 255, 0.2), 0 0 0 48px rgba(255, 255, 255, 0.2); animation: ripples 1s linear infinite; animation-play-state: running; opacity: 1; visibility: visible; transform: scale(0.6); z-index: 0; } .is-style-video .wp-block-button__link::after { content: "\f235"; position: absolute; font-family: "dashicons"; font-size: 25px; } .wp-block-button.is-style-video .wp-block-button__link:hover, .editor-styles-wrapper .is-style-video.wp-block-button .wp-block-button__link:hover { box-shadow: 0px 4px 10px var(--wp--preset--color--primary); } .wp-block-button.is-style-video .wp-block-button__link:hover:before, .editor-styles-wrapper .is-style-video.wp-block-button .wp-block-button__link:hover:before { animation-play-state: paused; opacity: 0; visibility: hidden; transition: 0.3s; }', ) ); /** Read More */ register_block_style( 'core/read-more', array( 'name' => 'primary-button', 'label' => esc_html__( 'Primary Button', 'appzend' ), 'inline_style' => ' .is-style-primary-button.wp-block-read-more{ overflow: hidden; position: relative; z-index: 1; vertical-align: middle; padding-right:55px; cursor: pointer; background: var(--wp--preset--color--primary); color: var(--wp--preset--color--white); } .is-style-primary-button.wp-block-read-more::after { content: "\f344"; position: absolute; margin-left: 5px; font-family: "dashicons"; } .is-style-primary-button.wp-block-read-more:before{ content: ""; position: absolute; z-index: -1; background-color: var(--wp--preset--color--black); left: auto; right: 0; top: 0; height: 100%; width: 0; -webkit-transition: all ease 0.4s; -o-transition: all ease 0.4s; transition: all ease 0.4s; } .is-style-primary-button.wp-block-read-more:hover{ color: var(--wp--preset--color--white); } .is-style-primary-button.wp-block-read-more:hover:before{ width: 101%; right: auto; left: 0; }', ) ); register_block_style( 'core/read-more', array( 'name' => 'secondary-button', 'label' => esc_html__( 'Secondary Button', 'appzend' ), 'inline_style' => ' .is-style-secondary-button.wp-block-read-more{ overflow: hidden; position: relative; z-index: 1; padding-right:55px; cursor: pointer; background-color: var(--wp--preset--color--white); color: var(--wp--preset--color--primary); border: 2px solid var(--wp--preset--color--primary); } .is-style-secondary-button.wp-block-read-more::after { content: "\f344"; position: absolute; margin-left: 5px; font-family: "dashicons"; } .is-style-secondary-button.wp-block-read-more:before { content: ""; position: absolute; z-index: -1; background-color: var(--wp--preset--color--primary); left: auto; right: 0; top: 0; height: 100%; width: 0; -webkit-transition: all ease 0.4s; -o-transition: all ease 0.4s; transition: all ease 0.4s; } .is-style-secondary-button.wp-block-read-more:hover { color: var(--wp--preset--color--white); } .is-style-secondary-button.wp-block-read-more:hover:before { width: 101%; right: auto; left: 0; }', ) ); register_block_style( 'core/read-more', array( 'name' => 'no-border', 'label' => esc_html__( 'No Border', 'appzend' ), 'inline_style' => ' .is-style-no-border.wp-block-read-more{ overflow: hidden; position: relative; z-index: 1; vertical-align: middle; cursor: pointer; background-color: transparent; color: var(--wp--preset--color--black); } .is-style-no-border.wp-block-read-more::after { content: "\f344"; position: absolute; margin-left: 5px; font-family: "dashicons"; } .is-style-no-border.wp-block-read-more:hover { color: var(--wp--preset--color--primary); }', ) ); } } add_action( 'init', 'appzend_register_block_patterns', 9 );