tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * 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' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary_one' => esc_html__( 'Primary Left Menu', 'foodhunt' ), 'primary_two' => esc_html__( 'Primary Right Menu', 'foodhunt' ), 'social' => esc_html__( 'Social Menu', 'foodhunt' ), 'footer' => esc_html__( 'Footer Menu', 'foodhunt' ) ) ); // Register image sizes for use in widgets add_image_size( 'foodhunt-blog', 870, 480, true ); add_image_size( 'foodhunt-featured-image', 340, 340, true ); // Adding excerpt option box for pages as well add_post_type_support( 'page', 'excerpt' ); /* * 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', ) ); /* * Enable support for Post Formats. * See https://developer.wordpress.org/themes/functionality/post-formats/ */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'foodhunt_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); } endif; // foodhunt_setup add_action( 'after_setup_theme', 'foodhunt_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 */ if ( ! isset( $content_width ) ) $content_width = 870; /* pixels */ if ( ! function_exists( 'foodhunt_content_width' ) ) : /** * Change the content width based on the Theme Settings and Page/Post Settings */ function foodhunt_content_width() { global $content_width; $classes = foodhunt_layout_class(); if ( $classes == 'no-sidebar-full-width' ) { $content_width = 1200; } } endif; add_action( 'template_redirect', 'foodhunt_content_width' ); /** * Enqueue scripts and styles. */ function foodhunt_scripts() { $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; wp_enqueue_style( 'foodhunt-style', get_stylesheet_uri() ); wp_enqueue_style( 'foodhunt-google-font', '//fonts.googleapis.com/css?family=Lato:400,300,700|Great+Vibes' ); wp_enqueue_style( 'foodhunt-fontawesome', get_template_directory_uri().'/font-awesome/css/font-awesome' . $suffix . '.css', array(), '4.4.0' ); if( is_front_page() ) { wp_enqueue_script( 'foodhunt-bxslider', get_template_directory_uri() . '/js/jquery.bxslider' . $suffix . '.js', array('jquery'), '4.1.2', true ); wp_enqueue_script( 'foodhunt-parallax', get_template_directory_uri() . '/js/jquery.parallax-1.1.3' . $suffix . '.js', array('jquery'), '1.1.3', true ); } wp_enqueue_script( 'foodhunt-ticker', get_template_directory_uri() . '/js/jquery.ticker' . $suffix . '.js', array('jquery'), '1.2.1', true ); wp_enqueue_script( 'foodhunt-custom', get_template_directory_uri() . '/js/foodhunt-custom' . $suffix . '.js', array('jquery'), false, true ); $foodhunt_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); if(preg_match('/(?i)msie [1-8]/',$foodhunt_user_agent)) { wp_enqueue_script( 'html5', get_template_directory_uri() . 'js/html5shiv' . $suffix . '.js', true ); } if( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } // foodhunt_scripts add_action( 'wp_enqueue_scripts', 'foodhunt_scripts' ); /** * Enqeue scripts in admin section for widgets. */ function foodhunt_admin_scripts( $hook ) { global $post_type; if( $hook == 'widgets.php' || $hook == 'customize.php' ) { // Image Uploader wp_enqueue_media(); wp_enqueue_script( 'foodhunt-script', get_template_directory_uri() . '/js/image-uploader.js', false, '1.0', true ); // Color Picker wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'foodhunt-color-picker', get_template_directory_uri() . '/js/color-picker.js', array( 'wp-color-picker' ), false); } if( $post_type == 'page' ) { wp_enqueue_script( 'foodhunt-meta-toggle', get_template_directory_uri() . '/js/metabox-toggle.js', false, '1.0', true ); } } add_action('admin_enqueue_scripts', 'foodhunt_admin_scripts'); /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Custom Widgets. */ require get_template_directory() . '/inc/widgets.php'; /** * Template Tag file. */ require get_template_directory() . '/inc/foodhunt.php'; /** * Admin meta-boxes file. */ require get_template_directory() . '/inc/admin/meta-boxes.php'; global $duplicate_posts; $duplicate_posts = array();