| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * Define Theme Version |
|---|
| 4 | */ |
|---|
| 5 | define( 'AVENZA_THEME_VERSION', '1.7.1' ); |
|---|
| 6 | |
|---|
| 7 | function avenza_css() { |
|---|
| 8 | $parent_style = 'avril-parent-style'; |
|---|
| 9 | wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); |
|---|
| 10 | wp_enqueue_style( 'avenza-style', get_stylesheet_uri(), array( $parent_style )); |
|---|
| 11 | |
|---|
| 12 | wp_enqueue_style('avenza-color-default',get_stylesheet_directory_uri() .'/assets/css/color/default.css'); |
|---|
| 13 | wp_dequeue_style('avril-default'); |
|---|
| 14 | |
|---|
| 15 | wp_enqueue_style('avenza-media-query',get_stylesheet_directory_uri().'/assets/css/responsive.css'); |
|---|
| 16 | wp_dequeue_style('avril-media-query'); |
|---|
| 17 | wp_dequeue_style('avril-fonts'); |
|---|
| 18 | } |
|---|
| 19 | add_action( 'wp_enqueue_scripts', 'avenza_css',999); |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | function avenza_setup() { |
|---|
| 23 | add_editor_style( array( 'assets/css/editor-style.css', avenza_google_font() ) ); |
|---|
| 24 | |
|---|
| 25 | if (function_exists('add_image_size')) { |
|---|
| 26 | add_image_size('avenza-large-image', 856, 400, false); |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | /**** |
|---|
| 30 | * Let WordPress manage |
|---|
| 31 | */ |
|---|
| 32 | |
|---|
| 33 | add_theme_support( 'post-thumbnails' ); |
|---|
| 34 | add_theme_support( 'title-tag' ); |
|---|
| 35 | add_theme_support( 'automatic-feed-links' ); |
|---|
| 36 | add_theme_support( 'custom-background' ); |
|---|
| 37 | add_theme_support( 'custom-logo' ); |
|---|
| 38 | add_theme_support( 'align-wide' ); |
|---|
| 39 | add_theme_support( 'add_editor_style()' ); |
|---|
| 40 | add_theme_support( 'html5', array('search-form','comment-form','comment-list','gallery','caption')); |
|---|
| 41 | } |
|---|
| 42 | add_action( 'after_setup_theme', 'avenza_setup' ); |
|---|
| 43 | |
|---|
| 44 | /** |
|---|
| 45 | * Called all the Customize file. |
|---|
| 46 | */ |
|---|
| 47 | require( get_stylesheet_directory() . '/inc/customize/avenza-premium.php'); |
|---|
| 48 | |
|---|
| 49 | /** |
|---|
| 50 | * Register Google fonts for Avenza. |
|---|
| 51 | */ |
|---|
| 52 | function avenza_google_font() { |
|---|
| 53 | |
|---|
| 54 | $get_fonts_url = ''; |
|---|
| 55 | |
|---|
| 56 | $font_families = array(); |
|---|
| 57 | |
|---|
| 58 | $font_families = array('Poppins:300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i'); |
|---|
| 59 | |
|---|
| 60 | $query_args = array( |
|---|
| 61 | 'family' => urlencode( implode( '|', $font_families ) ), |
|---|
| 62 | 'subset' => urlencode( 'latin,latin-ext' ), |
|---|
| 63 | ); |
|---|
| 64 | |
|---|
| 65 | $get_fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' ); |
|---|
| 66 | |
|---|
| 67 | return $get_fonts_url; |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | function avenza_scripts_styles() { |
|---|
| 71 | wp_enqueue_style( 'avenza-fonts', avenza_google_font(), array(), null ); |
|---|
| 72 | } |
|---|
| 73 | add_action( 'wp_enqueue_scripts', 'avenza_scripts_styles' ); |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | /** |
|---|
| 77 | * Called all the Customize file. |
|---|
| 78 | */ |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | /** |
|---|
| 82 | * Import Options From Parent Theme |
|---|
| 83 | * |
|---|
| 84 | */ |
|---|
| 85 | function avenza_parent_theme_options() { |
|---|
| 86 | $avril_mods = get_option( 'theme_mods_axtria' ); |
|---|
| 87 | if ( ! empty( $avril_mods ) ) { |
|---|
| 88 | foreach ( $avril_mods as $avril_mod_k => $avril_mod_v ) { |
|---|
| 89 | set_theme_mod( $avril_mod_k, $avril_mod_v ); |
|---|
| 90 | } |
|---|
| 91 | } |
|---|
| 92 | } |
|---|
| 93 | add_action( 'after_switch_theme', 'avenza_parent_theme_options' ); |
|---|
| 94 | |
|---|
| 95 | function avenza_remove_parent_setting( $wp_customize ) { |
|---|
| 96 | $wp_customize->remove_control('breadcrumb_contents'); |
|---|
| 97 | } |
|---|
| 98 | add_action( 'customize_register', 'avenza_remove_parent_setting',99 ); |
|---|
| 99 | |
|---|