get('TextDomain')); define("ROX_THEME_VERSION", $theme->get('Version')); define("ROX_THEME_NAME", $theme->get('Name')); /*---------------------------------------------------------------------- * Loading Core File and Script Loader *----------------------------------------------------------------------*/ require get_template_directory() . '/inc/rox-theme-include.php'; /*---------------------------------------------------------------------- * content width based on the theme's design and stylesheet. *----------------------------------------------------------------------*/ if (!isset($content_width)) { $content_width = 870; /* pixels */ } /*---------------------------------------------------------------------- * Initializing theme dependency after theme install *----------------------------------------------------------------------*/ /*---------------------------------------------------------------------- * Initial Theme Related Defination *----------------------------------------------------------------------*/ if (!function_exists('rox_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 rox_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on Pxlrtheme, use a find and replace * to change 'ayyash' to the name of your theme in all the template files */ if (!load_theme_textdomain('ayyash', get_stylesheet_directory() . '/languages')) { load_theme_textdomain('ayyash', get_template_directory() . '/languages'); } if(get_theme_mod('woocommerce_general_enable_product_zoom')){ add_theme_support( 'wc-product-gallery-zoom' ); } if(get_theme_mod('woocommerce_general_enable_product_lightbox')){ add_theme_support( 'wc-product-gallery-lightbox' ); } if(get_theme_mod('woocommerce_general_enable_product_gallery_slider')){ add_theme_support( 'wc-product-gallery-slider' ); } // 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 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 http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support('post-thumbnails'); add_image_size('rox-blog-grid', 540, 420, true); add_image_size('rox-gallery', 420, 420, true); add_image_size('rox-vertical', 300, 580, true); add_image_size('rox-woocom-thumb', 300, 375, true); $blog_normal = rox_get_mod('layout_blog_normal_image'); $blog_medium = rox_get_mod('layout_blog_medium_image'); $blog_grid = rox_get_mod('layout_blog_grid_image'); $blog_normalo = explode(',',$blog_normal); $blog_mediumo = explode(',',$blog_medium); $blog_grido = explode(',',$blog_grid); add_image_size('blog-normal', $blog_normalo[0], $blog_normalo[1], true); add_image_size('blog-medium', $blog_mediumo[0], $blog_mediumo[1], true); add_image_size('blog-grid', $blog_grido[0], $blog_grido[1], true); // This theme uses wp_nav_menu() in one location. register_nav_menus(array('primary' => __('Primary Menu', 'ayyash'),)); //Mobile Menu register_nav_menus(array('mobile' => __('Mobile Menu ( Select when mobile menu is different )', 'ayyash'),)); /* * 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',)); // Set up the WordPress core custom background feature. add_theme_support('custom-background', apply_filters('rox_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ))); // Set up the WordPress core custom header feature. $rox_custom_header_args = array( 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); add_theme_support( 'custom-header', $rox_custom_header_args ); } endif; add_action('after_setup_theme', 'rox_setup'); //Enable Flying cArt from theme if( ! function_exists( 'fn_rox_extensions_flying_cart' ) ) { function fn_rox_extensions_flying_cart( $show_flying_cart ) { if(rox_get_mod('woocommerce_general_enable_product_flying_cart') == 1){ return $show_flying_cart; } else { return false; } } } add_filter( 'rox_extensions_flying_cart', 'fn_rox_extensions_flying_cart', 10, 1 ); /** * Registers an editor stylesheet for the theme. */ function rox_theme_add_editor_styles() { add_editor_style( 'rox-editor-style.css' ); } add_action( 'admin_init', 'rox_theme_add_editor_styles' ); /** * Enqueue Comments Reply */ if( ! function_exists( 'rox_enqueue_comments_reply' ) ) { function rox_enqueue_comments_reply() { if ( is_singular() && comments_open() && ( get_option( 'thread_comments' ) == 1 ) ) { // Load comment-reply.js (into footer) wp_enqueue_script( 'comment-reply', 'wp-includes/js/comment-reply', array(), false, true ); } } } add_action( 'comment_form_before', 'rox_enqueue_comments_reply' ); /*---------------------------------------------------------------------- * Advice for theme developer read carefully * If you are developing theme using ayyash Starter theme make sure Not to write any new theme function (The theme you are going to release using our starter framework) Anywhere , Just use inc/rox-theme-extras.php which we created for developer who is using ayyash for theme development . By maintaining this advice , you can able to update base framework easily. Because we will not write anything in the file. *----------------------------------------------------------------------*/