240, 'width' => 240, 'flex-height' => true, )); add_theme_support('custom-background', array( 'default-color' => 'ffffff', )); } endif; add_action('after_setup_theme', 'catering_lite_setup'); add_action( 'wp_enqueue_scripts', 'catering_lite_enqueue_styles' ); function catering_lite_enqueue_styles() { wp_enqueue_style( 'bootstrap-css', get_template_directory_uri().'/css/bootstrap.css' ); $parent_style = 'food-truck-lite-basic-style'; // Style handle of parent theme. wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'catering-lite-style', get_stylesheet_uri(), array( $parent_style ) ); if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } wp_enqueue_style( 'catering-lite-block-patterns-style-frontend', get_theme_file_uri('/block-patterns/css/block-frontend.css') ); } function catering_lite_enqueue_customizer_css() { wp_enqueue_style( 'catering_lite-customizer-css', get_stylesheet_directory_uri() . '/css/customize-controls.css' ); } add_action( 'customize_controls_print_styles', 'catering_lite_enqueue_customizer_css' ); function catering_lite_widgets_init() { register_sidebar( array( 'name' => __( 'Blog Sidebar', 'catering-lite' ), 'description' => __( 'Appears on blog page sidebar', 'catering-lite' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'catering_lite_widgets_init' ); function catering_lite_customize_register() { global $wp_customize; $wp_customize->remove_setting( 'food_truck_lite_first_theme_color' ); $wp_customize->remove_control( 'food_truck_lite_first_theme_color' ); $wp_customize->remove_setting( 'food_truck_lite_second_theme_color' ); $wp_customize->remove_control( 'food_truck_lite_second_theme_color' ); // What we do Section $wp_customize->add_section('catering_lite_recipe_section',array( 'title' => __('Recipe Section','catering-lite'), 'description' => __('Add Recipee sections below.','catering-lite'), 'priority' => 30, 'panel' => 'food_truck_lite_panel_id', )); $wp_customize->add_setting('catering_lite_small_title',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('catering_lite_small_title',array( 'label' => __('Section Small Title','catering-lite'), 'section' => 'catering_lite_recipe_section', 'type' => 'text' )); $wp_customize->add_setting('catering_lite_section_title',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('catering_lite_section_title',array( 'label' => __('Section Title','catering-lite'), 'section' => 'catering_lite_recipe_section', 'type' => 'text' )); $args = array('numberposts' => -1); $post_list = get_posts($args); $i = 0; $pst2[]='Select'; foreach($post_list as $post){ $pst2[$post->post_title] = $post->post_title; } $wp_customize->add_setting('catering_lite_video_post',array( 'sanitize_callback' => 'food_truck_lite_sanitize_choices', )); $wp_customize->add_control('catering_lite_video_post',array( 'type' => 'select', 'choices' => $pst2, 'label' => __('Select video post','catering-lite'), 'section' => 'catering_lite_recipe_section', )); // category $categories = get_categories(); $cats = array(); $i = 0; $cat_post1[]= 'select'; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $cat_post1[$category->slug] = $category->name; } $wp_customize->add_setting( 'catering_lite_recipe_category', array( 'default' => '', 'sanitize_callback' => 'food_truck_lite_sanitize_choices' )); $wp_customize->add_control('catering_lite_recipe_category',array( 'type' => 'select', 'choices' => $cat_post1, 'label' => __('Select Category to display Latest Post','catering-lite'), 'section' => 'catering_lite_recipe_section', )); $wp_customize->add_setting('catering_lite_viewall_btn_text',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('catering_lite_viewall_btn_text',array( 'label' => __('View All Button Text','catering-lite'), 'section' => 'catering_lite_recipe_section', 'type' => 'text' )); $wp_customize->add_setting('catering_lite_viewall_btn_url',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control('catering_lite_viewall_btn_url',array( 'label' => __('View All Button URL','catering-lite'), 'section' => 'catering_lite_recipe_section', 'type' => 'text' )); } add_action( 'customize_register', 'catering_lite_customize_register', 11 ); if ( ! defined( 'FOOD_TRUCK_LITE_PRO_NAME' ) ) { define( 'FOOD_TRUCK_LITE_PRO_NAME', __( 'Catering Pro', 'catering-lite' )); } if ( ! defined( 'FOOD_TRUCK_LITE_PRO_URL' ) ) { define( 'FOOD_TRUCK_LITE_PRO_URL', __( 'https://www.themesglance.com/themes/catering-company-wordpress-theme/', 'catering-lite' )); } function catering_lite_remove_parent_function() { remove_action( 'admin_notices', 'food_truck_lite_activation_notice' ); remove_action( 'admin_menu', 'food_truck_lite_gettingstarted' ); } add_action( 'init', 'catering_lite_remove_parent_function'); /** * Enqueue block editor style */ function catering_lite_block_editor_styles() { wp_enqueue_style( 'catering-lite-font', food_truck_lite_font_url(), array() ); wp_enqueue_style( 'catering-lite-block-patterns-style-editor', get_theme_file_uri( '/block-patterns/css/block-editor.css' ), false, '1.0', 'all' ); wp_enqueue_style( 'font-awesome-css', get_template_directory_uri().'/css/fontawesome-all.css' ); } add_action( 'enqueue_block_editor_assets', 'catering_lite_block_editor_styles' ); define('CATERING_LITE_SITE_URL',__('https://www.themesglance.com/themes/free-catering-wordpress-theme/','catering-lite')); function catering_lite_credit_link() { echo "".esc_html__('Catering Lite WordPress Theme','catering-lite').""; } /* Block Pattern */ require get_theme_file_path('/block-patterns/block-patterns.php');