<?php /** * FoodTechPro functions and definitions */ if ( ! defined( 'ABSPATH' ) ) exit; define( 'FOODTECHPRO_VERSION', '1.0.0' ); // --------------------------------------------------------------- // Theme setup // --------------------------------------------------------------- function foodtechpro_setup() { load_theme_textdomain( 'foodtechpro', get_template_directory() . '/languages' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'html5', [ 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script' ] ); add_theme_support( 'customize-selective-refresh-widgets' ); add_theme_support( 'wp-block-styles' ); add_theme_support( 'align-wide' ); add_image_size( 'foodtechpro-hero', 1280, 720, true ); add_image_size( 'foodtechpro-card', 800, 533, true ); add_image_size( 'foodtechpro-thumb', 400, 267, true ); register_nav_menus( [ 'primary' => __( 'Primary Menu', 'foodtechpro' ), 'footer' => __( 'Footer Menu', 'foodtechpro' ), ] ); } add_action( 'after_setup_theme', 'foodtechpro_setup' ); // --------------------------------------------------------------- // Enqueue scripts & styles // --------------------------------------------------------------- function foodtechpro_scripts() { // Main stylesheet wp_enqueue_style( 'foodtechpro-style', get_stylesheet_uri(), [], FOODTECHPRO_VERSION ); // Enhanced responsive stylesheet wp_enqueue_style( 'foodtechpro-responsive', get_template_directory_uri() . '/responsive.css', [ 'foodtechpro-style' ], FOODTECHPRO_VERSION ); // Responsive navigation & interactions (includes mobile menu, search toggle, keyboard a11y) // Note: navigation.js kept as reference; responsive.js is the active handler wp_enqueue_script( 'foodtechpro-responsive', get_template_directory_uri() . '/js/responsive.js', [], FOODTECHPRO_VERSION, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'foodtechpro_scripts' ); // --------------------------------------------------------------- // Widget areas // --------------------------------------------------------------- function foodtechpro_widgets_init() { register_sidebar( [ 'name' => __( 'Blog Sidebar', 'foodtechpro' ), 'id' => 'sidebar-1', 'description' => __( 'Add widgets here to appear in the blog sidebar.', 'foodtechpro' ), 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ] ); register_sidebar( [ 'name' => __( 'Footer Column 1', 'foodtechpro' ), 'id' => 'footer-1', 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ] ); } add_action( 'widgets_init', 'foodtechpro_widgets_init' ); // --------------------------------------------------------------- // Excerpt length // --------------------------------------------------------------- function foodtechpro_excerpt_length( $length ) { return 25; } add_filter( 'excerpt_length', 'foodtechpro_excerpt_length' ); function foodtechpro_excerpt_more( $more ) { return '&hellip; <a class="read-more" href="' . get_permalink() . '">' . __( 'Read more', 'foodtechpro' ) . '</a>'; } add_filter( 'excerpt_more', 'foodtechpro_excerpt_more' ); // --------------------------------------------------------------- // Body classes // --------------------------------------------------------------- function foodtechpro_body_classes( $classes ) { if ( is_singular() ) $classes[] = 'singular'; if ( ! is_singular() ) $classes[] = 'hfeed'; return $classes; } add_filter( 'body_class', 'foodtechpro_body_classes' ); // --------------------------------------------------------------- // Category icon helper // --------------------------------------------------------------- function foodtechpro_category_icon( $slug ) { $icons = [ 'food-industry' => '🏭', 'food-safety' => '🛡️', 'food-technology' => '🔬', 'fssai-updates' => '📋', 'research' => '📊', ]; echo esc_html( $icons[ $slug ] ?? '📝' ); } // --------------------------------------------------------------- // Custom logo defaults // --------------------------------------------------------------- function foodtechpro_custom_logo_setup() { add_theme_support( 'custom-logo', [ 'height' => 60, 'width' => 200, 'flex-width' => true, 'flex-height' => true, ] ); } add_action( 'after_setup_theme', 'foodtechpro_custom_logo_setup' ); https://foodtechpro.co.in/post-sitemap.xml 2026-06-25T04:54:14+00:00 https://foodtechpro.co.in/page-sitemap.xml 2026-06-25T06:43:37+00:00 https://foodtechpro.co.in/category-sitemap.xml 2026-06-25T04:54:14+00:00 https://foodtechpro.co.in/post_tag-sitemap.xml 2026-06-25T04:54:13+00:00 https://foodtechpro.co.in/author-sitemap.xml 2026-06-23T13:59:39+00:00