parent()->get('Version')); wp_enqueue_style( 'digi-restaurant-style', get_stylesheet_uri(), array( $parentcss ), $theme->get('Version')); } add_action( 'wp_enqueue_scripts', 'digi_restaurant_enqueue_styles' ); function digi_restaurant_string_limit_words($string, $word_limit) { $words = explode(' ', $string, ($word_limit + 1)); if(count($words) > $word_limit) array_pop($words); return implode(' ', $words); } function digi_restaurant_customize_register($wp_customize){ // Banner Section $wp_customize->add_section( 'digi_restaurant_top_image_section' , array( 'title' => __( 'Banner Settings', 'digi-restaurant' ), 'priority' => null ) ); $wp_customize->add_setting('digi_restaurant_top_section_heading',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('digi_restaurant_top_section_heading',array( 'label' => esc_html__('Section Title','digi-restaurant'), 'section' => 'digi_restaurant_top_image_section', 'setting' => 'digi_restaurant_top_section_heading', 'type' => 'text' )); $wp_customize->add_setting('digi_restaurant_top_section_content',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('digi_restaurant_top_section_content',array( 'label' => esc_html__('Section Content','digi-restaurant'), 'section' => 'digi_restaurant_top_image_section', 'setting' => 'digi_restaurant_top_section_content', 'type' => 'text' )); $wp_customize->add_setting('digi_restaurant_top_section_text',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('digi_restaurant_top_section_text',array( 'label' => esc_html__('Button Text','digi-restaurant'), 'section' => 'digi_restaurant_top_image_section', 'setting' => 'digi_restaurant_top_section_text', 'type' => 'text' )); $wp_customize->add_setting('digi_restaurant_top_section_url',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('digi_restaurant_top_section_url',array( 'label' => esc_html__('Button URL','digi-restaurant'), 'section' => 'digi_restaurant_top_image_section', 'setting' => 'digi_restaurant_top_section_url', 'type' => 'url' )); $wp_customize->add_setting('digi_restaurant_image_one', array( 'transport' => 'refresh', 'height' => 325, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'digi_restaurant_image_one', array( 'label' => esc_html__('Image #1', 'digi-restaurant'), 'section' => 'digi_restaurant_top_image_section', 'settings' => 'digi_restaurant_image_one', ))); $wp_customize->add_setting('digi_restaurant_image_two', array( 'transport' => 'refresh', 'height' => 325, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'digi_restaurant_image_two', array( 'label' => esc_html__('Image #2', 'digi-restaurant'), 'section' => 'digi_restaurant_top_image_section', 'settings' => 'digi_restaurant_image_two', ))); $wp_customize->add_setting('digi_restaurant_image_three', array( 'transport' => 'refresh', 'height' => 325, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'digi_restaurant_image_three', array( 'label' => esc_html__('Image #3', 'digi-restaurant'), 'section' => 'digi_restaurant_top_image_section', 'settings' => 'digi_restaurant_image_three', ))); $wp_customize->add_setting('digi_restaurant_image_four', array( 'transport' => 'refresh', 'height' => 325, 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'digi_restaurant_image_four', array( 'label' => esc_html__('Image #4', 'digi-restaurant'), 'section' => 'digi_restaurant_top_image_section', 'settings' => 'digi_restaurant_image_four', ))); // Welcome Section $wp_customize->add_section( 'digi_restaurant_welcome_section' , array( 'title' => esc_html__( 'Welcome Section Settings', 'digi-restaurant' ), 'priority' => null ) ); $wp_customize->add_setting('digi_restaurant_welcome_section_heading',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('digi_restaurant_welcome_section_heading',array( 'label' => esc_html__('Section Heading','digi-restaurant'), 'section' => 'digi_restaurant_welcome_section', 'setting' => 'digi_restaurant_welcome_section_heading', 'type' => 'text' )); $wp_customize->add_setting( 'digi_restaurant_welcome_page', array( 'default' => '', 'sanitize_callback' => 'restaurant_zone_sanitize_dropdown_pages' ) ); $wp_customize->add_control( 'digi_restaurant_welcome_page', array( 'label' => esc_html__( 'Select Page', 'digi-restaurant' ), 'section' => 'digi_restaurant_welcome_section', 'type' => 'dropdown-pages' ) ); } add_action('customize_register', 'digi_restaurant_customize_register'); if ( ! function_exists( 'digi_restaurant_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function digi_restaurant_setup() { add_theme_support( 'responsive-embeds' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded