<?php /** * @package WordPress * @subpackage Your Inspiration Themes */ yit_register_slider_style($slider_type, 'slider-elastic', 'css/elastic.css'); yit_register_slider_script($slider_type, 'jquery-eislideshow', 'js/jquery.eislideshow.js'); // set here if the slider is reponsive or not $this->responsive_sliders[$slider_type] = true; // add image size yit_add_image_size('thumb-slider-elastic', 150, 59, true); // add support to slide yit_add_slide_support($slider_type, 'title, subtitle, link'); // add the slider fields for the admin yit_add_slider_config($slider_type, array(array('name' => __('Width', 'yit'), 'id' => 'width', 'type' => 'number', 'desc' => __('Select the width of the slider, in base of the images that you want to add (Set 0 if you want it full width).', 'yit'), 'min' => 0, 'max' => 2000, 'std' => 0), array('name' => __('Height', 'yit'), 'id' => 'height', 'type' => 'number', 'desc' => __('Select the height of the slider, in base of the images that you want to add.', 'yit'), 'std' => 338, 'min' => 200, 'max' => 2000), array('name' => __('Autoplay', 'yit'), 'id' => 'autoplay', 'type' => 'onoff', 'desc' => __('Select if you want that the slider change the slide automatically.', 'yit'), 'std' => 1), array('name' => __('Animation', 'yit'), 'id' => 'animation', 'type' => 'select', 'options' => array('sides' => __('Sides', 'yit'), 'center' => __('Center', 'yit')), 'desc' => __('Animation types -> "sides" : new slides will slide in from left / right; "center": new slides will appear in the center.', 'yit'), 'std' => 'sides'), array('name' => __('Pause between slides (s)', 'yit'), 'id' => 'interval', 'type' => 'slider', 'desc' => __('Select the delay between slides, expressed in seconds.', 'yit'), 'min' => 0.1, 'max' => 20, 'step' => 0.1, 'std' => 3), array('name' => __('Animation speed (s)', 'yit'), 'id' => 'speed', 'type' => 'slider', 'desc' => __('The speed of the animation between two slide, expressed in seconds.', 'yit'), 'min' => 0.1, 'max' => 20, 'step' => 0.1, 'std' => 0.8))); // add the slider fields for the admin yit_slider_typography_options($slider_type, array(array('id' => 'title-font', 'type' => 'typography', 'name' => __('Title', 'yit'), 'desc' => __('Configure the title.', 'yit'), 'min' => 1, 'max' => 72, 'std' => array('size' => 40, 'unit' => 'px', 'family' => 'Playfair Display', 'style' => 'italic', 'color' => '#000000'), 'style' => array('selectors' => '.slider-%s .ei-title h2, .slider-%s .ei-title h2 a', 'properties' => 'font-size, font-family, color, font-style, font-weight')), array('id' => 'subtitle-font', 'type' => 'typography', 'name' => __('Subitle', 'yit'), 'desc' => __('Configure the subtitle.', 'yit'), 'min' => 1, 'max' => 72, 'std' => array('size' => 40, 'unit' => 'px', 'family' => 'Open Sans Condensed:300', 'style' => 'regular', 'color' => '#4D4C4C'), 'style' => array('selectors' => '.slider-%s .ei-title h3, .slider-%s .ei-title h3 a', 'properties' => 'font-size, font-family, color, font-style, font-weight'))));
<?php /** * @package WordPress * @subpackage Your Inspiration Themes */ yit_register_slider_style($slider_type, 'slider-thumbnail', 'css/thumbnails.css'); yit_register_slider_script($slider_type, 'jquery-thumbnail', 'js/jquery.aw-showcase.js'); // set here if the slider is reponsive or not $this->responsive_sliders[$slider_type] = true; // add image size yit_add_image_size('thumb-slider-thumbnails', 226, 100, true); // add support to slide yit_add_slide_support($slider_type, 'title, subtitle'); // add the slider fields for the admin yit_add_slider_config($slider_type, array(array('name' => __('Effect', 'yit'), 'id' => 'effect', 'type' => 'select', 'desc' => __('Select the effect you want for slides transiction.', 'yit'), 'options' => array('vslide' => 'vslide', 'hslide' => 'hslide', 'fade' => 'fade'), 'std' => 'fade'), array('name' => __('Pause between slides (s)', 'yit'), 'id' => 'interval', 'type' => 'slider', 'desc' => __('Select the delay between slides, expressed in seconds.', 'yit'), 'min' => 0.1, 'max' => 20, 'step' => 0.1, 'std' => 3), array('name' => __('Animation speed (s)', 'yit'), 'id' => 'speed', 'type' => 'slider', 'desc' => __('The speed of the animation between two slide, expressed in seconds.', 'yit'), 'min' => 0.1, 'max' => 20, 'step' => 0.1, 'std' => 0.8), array('name' => __('Content width', 'yit'), 'id' => 'width', 'type' => 'number', 'desc' => __('Select the width of content (set 0 for full width feature).', 'yit'), 'min' => 0, 'max' => 2000, 'std' => 0), array('name' => __('Content height', 'yit'), 'id' => 'height', 'type' => 'number', 'desc' => __('Select the height of content (take in mind 22px of padding and border of the slider, so if you want the slider 400px height, set 378px as height.).', 'yit'), 'min' => 10, 'max' => 2000, 'std' => 378))); // add the slider fields for the admin yit_slider_typography_options($slider_type, array(array('id' => 'tooltip-font', 'type' => 'typography', 'name' => __('Caption font', 'yit'), 'desc' => __('Configure the tooltip title of the slide.', 'yit'), 'min' => 1, 'max' => 72, 'std' => array('size' => 26, 'unit' => 'px', 'family' => 'Lato', 'style' => 'bold', 'color' => '#585555'), 'style' => array('selectors' => '.slider-%s.slider div.showcase-text h2', 'properties' => 'font-size, font-family, color, font-style, font-weight')), array('id' => 'extra-tooltip-font', 'type' => 'typography', 'name' => __('Tooltip text font', 'yit'), 'desc' => __('Configure the font of the text in the slide.', 'yit'), 'min' => 1, 'max' => 72, 'std' => array('size' => 12, 'unit' => 'px', 'family' => 'Lato', 'style' => 'regular', 'color' => '#6e6e6e'), 'style' => array('selectors' => '.slider-%s.slider div.showcase-text p', 'properties' => 'font-size, font-family, color, font-style, font-weight'))));
/** * Set up all theme data. * * @return void * @since 1.0.0 */ function yit_setup_theme() { //Content width. WP require it. So give to WordPress what is of WordPress if (!isset($content_width)) { $content_width = yit_get_option('container-width'); } //This theme have a CSS file for the editor TinyMCE add_editor_style('css/editor-style.css'); //This theme support post thumbnails add_theme_support('post-thumbnails'); //This theme uses the menues add_theme_support('menus'); //Add default posts and comments RSS feed links to head add_theme_support('automatic-feed-links'); //This theme support post formats add_theme_support('post-formats', apply_filters('yit_post_formats_support', array('gallery', 'audio', 'video', 'quote'))); if (!defined('HEADER_TEXTCOLOR')) { define('HEADER_TEXTCOLOR', ''); } // The height and width of your custom header. You can hook into the theme's own filters to change these values. // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values. define('HEADER_IMAGE_WIDTH', apply_filters('yiw_header_image_width', 1170)); define('HEADER_IMAGE_HEIGHT', apply_filters('yiw_header_image_height', 410)); // Don't support text inside the header image. if (!defined('NO_HEADER_TEXT')) { define('NO_HEADER_TEXT', true); } //This theme support custom header add_theme_support('custom-header'); //This theme support custom backgrounds add_theme_support('custom-backgrounds'); // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be 940 pixels wide by 198 pixels tall. // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. // set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); $image_sizes = array('blog_small_image' => array(554, 577, true), 'blog_big' => array(864, 421, true), 'blog_thumb' => array(49, 49, true), 'section_blog' => array(261, 173, true), 'section_services' => array(175, 175, true), 'section_portfolio' => array(270, 270, true), 'section_portfolio_large' => array(270, 370, true), 'section_portfolio_small' => array(270, 170, true), 'thumb-testimonial' => array(160, 160, true), 'thumb-testimonial-quote' => array(160, 160, true), 'thumb_portfolio_fulldesc_related' => array(270, 170, true), 'thumb_portfolio_bigimage' => array(656, 0), 'thumb_portfolio_filterable' => array(270, 168, true), 'thumb_portfolio_fulldesc' => array(574, 340, true), 'thumb_portfolio_fulldesc_big' => array(1158, 400, true), 'portfolio_gallery_thumb' => array(65, 65, true), 'section_video' => array(162, 136, true), 'thumb_portfolio_2cols' => array(570, 324, true), 'thumb_portfolio_3cols' => array(370, 216, true), 'thumb_portfolio_4cols' => array(270, 172, true), 'accordion_thumb' => array(266, 266, true), 'team_rounded_thumb' => array(130, 130, true), 'team_professional_thumb' => array(270, 270, true), 'team_professional_mini_thumb' => array(70, 70, true), 'featured_project_thumb' => array(320, 154, true), 'thumb_portfolio_slide' => array(560, 377, true), 'nav_menu' => array(170, 0), 'teaser_widget' => array(258, 0, false), 'sc_portfolio_3cols' => array(360, 260, true)); $image_sizes = apply_filters('yit_add_image_size', $image_sizes); foreach ($image_sizes as $id_size => $size) { yit_add_image_size($id_size, apply_filters('yit_' . $id_size . '_width', $size[0]), apply_filters('yit_' . $id_size . '_height', $size[1]), isset($size[2]) ? $size[2] : false); } //Register theme default header. Usually one // register_default_headers( array( // 'theme_header' => array( // 'url' => '%s/images/headers/001.jpg', // 'thumbnail_url' => '%s/images/headers/thumb/001.jpg', // /* translators: header image description */ // 'description' => __( 'Design', 'yit' ) . ' 1' // ) // ) ); //Set localization and load language file $locale = get_locale(); $locale_file = YIT_THEME_PATH . "/languages/{$locale}.php"; if (is_readable($locale_file)) { require_once $locale_file; } //Register menus register_nav_menus(array('nav' => __('Main Navigation', 'yit'), 'my-account-menu' => __('My Account Header Menu', 'yit'), 'my-account-page' => __('My Account Page Menu', 'yit'))); //create the main menu if it doesn't exist $menuname = 'Main Navigation'; if (!wp_get_nav_menu_object($menuname)) { $menu_id = wp_create_nav_menu($menuname); wp_update_nav_menu_item($menu_id, 0, array('menu-item-title' => __('HOME'), 'menu-item-classes' => 'home', 'menu-item-url' => home_url(), 'menu-item-status' => 'publish')); if (!has_nav_menu('nav')) { $locations = get_theme_mod('nav_menu_locations'); $locations['nav'] = $menu_id; set_theme_mod('nav_menu_locations', $locations); } } /* //create the menu items if they don't exist $menuname = 'Welcome Menu'; if( !wp_get_nav_menu_object( $menuname ) ) { $menu_id = wp_create_nav_menu($menuname); if( is_shop_installed() ) { if( get_option('woocommerce_myaccount_page_id') ) { wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('My Account', 'yit'), 'menu-item-object' => 'page', 'menu-item-object-id' => get_option('woocommerce_myaccount_page_id'), 'menu-item-type' => 'post_type', 'menu-item-status' => 'publish')); } if ( get_option('woocommerce_change_password_page_id') ) { wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('Change Password', 'yit'), 'menu-item-object' => 'page', 'menu-item-object-id' => get_option('woocommerce_change_password_page_id'), 'menu-item-type' => 'post_type', 'menu-item-status' => 'publish')); } if ( get_option('woocommerce_edit_address_page_id') ) { wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('Edit My Address', 'yit'), 'menu-item-object' => 'page', 'menu-item-object-id' => get_option('woocommerce_edit_address_page_id'), 'menu-item-type' => 'post_type', 'menu-item-status' => 'publish')); } if ( get_option('woocommerce_view_order_page_id') ) { wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('View Orders', 'yit'), 'menu-item-object' => 'page', 'menu-item-object-id' => get_option('woocommerce_view_order_page_id'), 'menu-item-type' => 'post_type', 'menu-item-status' => 'publish')); } if ( get_option('yith_wcwl_wishlist_page_id') ) { wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('Wishlist', 'yit'), 'menu-item-object' => 'page', 'menu-item-object-id' => get_option('yith_wcwl_wishlist_page_id'), 'menu-item-type' => 'post_type', 'menu-item-status' => 'publish')); } if( defined('YITH_WOOCOMPARE') && YITH_WOOCOMPARE ) { wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('Compare', 'yit'), 'menu-item-classes' => 'yith-woocompare-open', 'menu-item-url' => '#', 'menu-item-status' => 'publish')); } } wp_update_nav_menu_item($menu_id, 0, array( 'menu-item-title' => __('{logout}'), 'menu-item-classes' => 'logout', 'menu-item-url' => '#', 'menu-item-status' => 'publish')); if( !has_nav_menu( 'welcome-menu' ) ){ $locations = get_theme_mod('nav_menu_locations'); $locations['welcome-menu'] = $menu_id; set_theme_mod( 'nav_menu_locations', $locations ); } } */ //Register sidebars register_sidebar(yit_sidebar_args('Default Sidebar')); register_sidebar(yit_sidebar_args('Topbar Left', 'Left widget area for Tob Bar')); register_sidebar(yit_sidebar_args('Topbar Right', 'Right widget area for Tob Bar')); register_sidebar(yit_sidebar_args('Header Sidebar', 'Widget area near the navigation')); register_sidebar(yit_sidebar_args('Home Row', 'The widgets area used in the page with home template', 'home-widget span3')); register_sidebar(yit_sidebar_args('Blog Sidebar')); register_sidebar(yit_sidebar_args('Faq Sidebar', 'The widgets area used in the faqs page')); register_sidebar(yit_sidebar_args('404 Sidebar')); register_sidebar(yit_sidebar_args('Contact Sidebar', 'Widgets area for the contact page')); /********************** * Re-enable this sidebar when the skin 3 will be added *********************/ //register_sidebar( yit_sidebar_args( 'Header Sidebar', 'Widget area for Header', 'widget' ) ); //User defined sidebars do_action('yit_register_sidebars'); //Register custom sidebars $sidebars = maybe_unserialize(yit_get_option('custom-sidebars')); if (is_array($sidebars) && !empty($sidebars)) { foreach ($sidebars as $sidebar) { register_sidebar(yit_sidebar_args($sidebar, '', 'widget', apply_filters('yit_custom_sidebar_title_wrap', 'h3'))); } } //Footer with sidebar type widgets if (strstr(yit_get_option('footer-type'), 'sidebar')) { register_sidebar(yit_sidebar_args("Footer Widgets Area", __("The widget area used in Footer With Sidebar section", 'yit'), 'widget span2', apply_filters('yit_footer_widget_area_wrap', 'h3'))); register_sidebar(yit_sidebar_args("Footer Sidebar", __("The sidebar used in Footer With Sidebar section", 'yit'), 'widget span6', apply_filters('yit_footer_widget_area_wrap', 'h3'))); } //else { //Footer sidebars for ($i = 1; $i <= yit_get_option('footer-rows', 0); $i++) { register_sidebar(yit_sidebar_args("Footer Row {$i}", sprintf(__("The widget area #%d used in Footer section", 'yit'), $i), 'widget span' . 12 / yit_get_option('footer-columns'), apply_filters('yit_footer_sidebar_' . $i . '_wrap', 'h3'))); } //} //remove wpml stylesheet define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true); }
<?php /** * @package WordPress * @subpackage Your Inspiration Themes */ yit_register_portfolio_style( $portfolio_type, 'portfolio-' . $portfolio_type, 'css/style.css' ); yit_register_portfolio_script( $portfolio_type, 'jquery-yit_pagination', YIT_CORE_ASSETS_URL . '/js/yit/jquery.yit_pagination.js' ); yit_register_portfolio_script( $portfolio_type, 'jquery-imagesLoaded', YIT_THEME_JS_URL . '/jquery.imagesLoaded.js'); yit_register_portfolio_script( $portfolio_type, 'jquery-yit_portfolio_thumbs', 'js/jquery.yit_portfolio_thumbs.js' ); // add the image size yit_add_image_size( 'thumb_small_portfolio_thumbs', 60, 60, true ); yit_add_image_size( 'thumb_medium_portfolio_thumbs', 437, 261, true ); // add the slider fields for the admin yit_add_portfolio_config( $portfolio_type, array( array( 'name' => __( 'Enable lightbox icon', 'yit' ), 'id' => 'event_lightbox', 'type' => 'onoff', 'desc' => __( 'Enable lightbox icon on projects image.', 'yit' ), ), ) ); yit_add_portfolio_config( $portfolio_type, array( array( 'name' => __( 'Thumbs title', 'yit' ), 'id' => 'thumbs_title', 'type' => 'text', 'desc' => '',
/** * Set up all theme data. * * @return void * @since 1.0.0 */ function yit_setup_theme() { //Content width. WP require it. So give to WordPress what is of WordPress if ( ! isset( $content_width ) ) { $content_width = yit_get_option( 'container-width' ); } //This theme have a CSS file for the editor TinyMCE add_editor_style( 'css/editor-style.css' ); //This theme support post thumbnails add_theme_support( 'post-thumbnails' ); //This theme uses the menues add_theme_support( 'menus' ); //Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); //This theme support post formats add_theme_support( 'post-formats', apply_filters( 'yit_post_formats_support', array( 'gallery', 'audio', 'video', 'quote' ) ) ); if ( ! defined( 'HEADER_TEXTCOLOR' ) ) { define( 'HEADER_TEXTCOLOR', '' ); } // The height and width of your custom header. You can hook into the theme's own filters to change these values. // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values. define( 'HEADER_IMAGE_WIDTH', apply_filters( 'yiw_header_image_width', 1170 ) ); define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'yiw_header_image_height', 410 ) ); // Don't support text inside the header image. if ( ! defined( 'NO_HEADER_TEXT' ) ) { define( 'NO_HEADER_TEXT', true ); } //This theme support custom header add_theme_support( 'custom-header' ); //This theme support custom backgrounds add_theme_support( 'custom-backgrounds' ); // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be 940 pixels wide by 198 pixels tall. // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. // set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); $image_sizes = array( 'blog_big' => array( 890, 0, true ), 'blog_small' => array( 365, 320, true ), 'blog_elegant' => array( 539, 0, true ), 'blog_big_ribbon' => array( 760, 0, true ), 'blog_small_ribbon' => array( 370, 320, true ), 'blog_sphera' => array( 280, 305, true ), 'blog_bazar' => array( 858, 338, true ), 'blog_thumb' => array( 75, 75, true ), 'section_blog' => array( 263, 243, true ), 'section_services' => array( 175, 175, true ), 'thumb-testimonial' => array( 41, 41, true ), 'thumb-testimonial-circle' => array( 100, 100, true ), 'thumb-testimonial-quote' => array( 87, 85, true ), 'thumb-testimonial-square' => array( 116, 116, true ), 'thumb-testimonial-bazar' => array( 62, 62, true ), 'thumb_portfolio_fulldesc_related' => array( 258, 170, true ), 'thumb_portfolio_bigimage' => array( 656, 0 ), 'thumb_portfolio_filterable' => array( 260, 168, true ), 'thumb_portfolio_fulldesc' => array( 574, 340, true ), 'thumb_portfolio_fulldesc_big' => array( 1158, 400, true ), 'section_video' => array( 162, 136, true ), 'section_portfolio' => array( 660, 360, true ), 'section_portfolio_sidebar' => array( 385, 192, true ), 'section_portfolio_thumb' => array( 164, 106, true ), 'thumb_portfolio_2cols' => array( 560, 324, true ), 'thumb_portfolio_3cols' => array( 360, 216, true ), 'thumb_portfolio_4cols' => array( 260, 172, true ), 'accordion_thumb' => array( 266, 266, true ), 'team_rounded_thumb' => array( 130, 130, true ), 'team_professional_thumb' => array( 270, 270, true ), 'team_professional_mini_thumb' => array( 70, 70, true ), 'featured_project_thumb' => array( 320, 154, true ), 'thumb_portfolio_slide' => array( 560, 377, true ), 'thumb_portfolio_pinterest' => array( 260, 0 ), 'nav_menu' => array( 170, 0 ), ); $image_sizes = apply_filters( 'yit_add_image_size', $image_sizes ); foreach ( $image_sizes as $id_size => $size ) { yit_add_image_size( $id_size, apply_filters( 'yit_' . $id_size . '_width', $size[0] ), apply_filters( 'yit_' . $id_size . '_height', $size[1] ), isset( $size[2] ) ? $size[2] : false ); } //Register theme default header. Usually one // register_default_headers( array( // 'theme_header' => array( // 'url' => '%s/images/headers/001.jpg', // 'thumbnail_url' => '%s/images/headers/thumb/001.jpg', // /* translators: header image description */ // 'description' => __( 'Design', 'yit' ) . ' 1' // ) // ) ); //Set localization and load language file $locale = get_locale(); $locale_file = YIT_THEME_PATH . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) { require_once( $locale_file ); } //Register menus register_nav_menus( array( 'nav' => __( 'Main navigation', 'yit' ), //'top' => __( 'Top Bar', 'yit' ) ) ); //Register sidebars register_sidebar( yit_sidebar_args( 'Default Sidebar' ) ); register_sidebar( yit_sidebar_args( 'Home Sidebar', 'Widget area for Home Page Template', 'home-widget span3' ) ); register_sidebar( yit_sidebar_args( 'Blog Sidebar' ) ); register_sidebar( yit_sidebar_args( '404 Sidebar' ) ); register_sidebar( yit_sidebar_args( 'Header Sidebar', 'Widget area for Header', 'widget' ) ); register_sidebar( yit_sidebar_args( 'Topbar Left', 'Left widget area for Tob Bar' ) ); register_sidebar( yit_sidebar_args( 'Topbar Right', 'Right widget area for Tob Bar' ) ); //User defined sidebars do_action( 'yit_register_sidebars' ); //Register custom sidebars $sidebars = maybe_unserialize( yit_get_option( 'custom-sidebars' ) ); if ( is_array( $sidebars ) && ! empty( $sidebars ) ) { foreach ( $sidebars as $sidebar ) { register_sidebar( yit_sidebar_args( $sidebar, '', 'widget', apply_filters( 'yit_custom_sidebar_title_wrap', 'h3' ) ) ); } } //Footer with sidebar type widgets if ( strstr( yit_get_option( 'footer-type' ), 'sidebar' ) ) { register_sidebar( yit_sidebar_args( "Footer Widgets Area", __( "The widget area used in Footer With Sidebar section", 'yit' ), 'widget span2', apply_filters( 'yit_footer_widget_area_wrap', 'h3' ) ) ); register_sidebar( yit_sidebar_args( "Footer Sidebar", __( "The sidebar used in Footer With Sidebar section", 'yit' ), 'widget span6', apply_filters( 'yit_footer_widget_area_wrap', 'h3' ) ) ); } //else { //Footer sidebars for ( $i = 1; $i <= yit_get_option( 'footer-rows', 0 ); $i ++ ) { register_sidebar( yit_sidebar_args( "Footer Row $i", sprintf( __( "The widget area #%d used in Footer section", 'yit' ), $i ), 'widget span' . ( 12 / yit_get_option( 'footer-columns' ) ), apply_filters( 'yit_footer_sidebar_' . $i . '_wrap', 'h3' ) ) ); } //} }
/** * Init * */ public function init() { // register the post types add_action('init', array(&$this, 'register_post_types')); // change the icon in the menu items add_action('admin_head', array(&$this, 'change_icon_menu')); // load the recerences for the post type unlimited page add_action('admin_enqueue_scripts', array(&$this, 'enqueue_references')); // add the options in the settings page of the post type add_action('settings-post-type-unlimited', array(&$this, 'settings_options')); // add the options in the settings page of the post type add_action('typography-post-type-unlimited', array(&$this, 'typography_options')); // add the options for each slide of the post type add_action('settings-item-post-type', array(&$this, 'settings_item'), 10, 1); // save the settings in the database, for each psot add_action('save_post', array(&$this, 'save_settings')); // add the image size for the thumbnails in the backend yit_add_image_size('admin-post-type-thumbnails', 140, 100, true); // add the ajax for the images settings reloading, after uploaded all images add_action('wp_ajax_update_images_post_type', array(&$this, 'update_items')); // add the ajax for the image url editing add_action('wp_ajax_update_image_post_type', array(&$this, 'update_item')); // add the ajax to generate the preview image for the admin add_action('wp_ajax_generate_preview_image_post_type', array(&$this, 'generate_preview')); // add the ajax for the images settings reloading, after uploaded all images add_action('wp_ajax_delete_item_post_type', array(&$this, 'delete_item')); // add the ajax for the images settings reloading, after uploaded all images add_action('wp_ajax_add_category_post_type', array(&$this, 'add_category')); // add the ajax useful to remove the category add_action('wp_ajax_delete_category_post_type', array(&$this, 'delete_category')); // add the template for the page of single element of post type add_filter('template_include', array(&$this, 'load_template_single')); // add the query vars for the template of single post page add_filter('query_vars', array(&$this, 'add_query_vars')); // fix classes in the navigation menu add_filter('wp_nav_menu_objects', array(&$this, 'nav_menu_item_classes'), 2, 20); // remove the autosave in the posts of the post type add_action('admin_enqueue_scripts', array(&$this, 'remove_autosave'), 1); // enqueue the stylesheets of google fonts, from the typography settings add_action('init', array(&$this, 'load_options_font')); // add the css rules for the typography, ready to be saved in the custom.css file add_action('yit_save_css', array(&$this, 'add_css_rules')); // give the ability to duplicate the posts add_action('admin_action_duplicate_post', array(&$this, 'duplicate_a_post_action')); // add the link to duplicate the posts add_filter('post_row_actions', array(&$this, 'duplicate_product_link_row'), 10, 2); }
<?php /** * @package WordPress * @subpackage Your Inspiration Themes */ yit_register_slider_style($slider_type, 'slider-thumbnail', 'css/thumbnails.css'); yit_register_slider_script($slider_type, 'jquery-thumbnail', 'js/jquery.aw-showcase.js'); // set here if the slider is reponsive or not $this->responsive_sliders[$slider_type] = true; // add image size yit_add_image_size('thumb-slider-thumbnails', 60, 60, true); // add support to slide yit_add_slide_support($slider_type, 'link', array(array('name' => __('Caption', 'yit'), 'id' => 'caption', 'type' => 'text', 'desc' => __('Define here the text to use in the caption of the slide.', 'yit'), 'std' => ''), array('type' => 'simple-text', 'desc' => '<b>' . __('Add Tooltip', 'yit') . '</b>'), array('name' => __('Tooltip Text', 'yit'), 'id' => 'tooltip_text', 'type' => 'textarea', 'desc' => __('Select the text to show inside the tooltip.', 'yit'), 'std' => ''), array('name' => __('Tooltip Image', 'yit'), 'id' => 'tooltip_image', 'type' => 'upload', 'desc' => __('You can add here an image to show above the text inside the tooltip (optional)', 'yit'), 'std' => ''), array('name' => __('URL', 'yit'), 'id' => 'tooltip_url', 'type' => 'text', 'desc' => __('Define here the URL where the tooltip have to point.', 'yit'), 'std' => ''), array('name' => __('Coords X', 'yit'), 'id' => 'tooltip_x', 'type' => 'number', 'desc' => __('Define here the position, from the left, where place the tooltip.', 'yit'), 'std' => '20'), array('name' => __('Coords Y', 'yit'), 'id' => 'tooltip_y', 'type' => 'number', 'desc' => __('Define here the position, from the top, where place the tooltip.', 'yit'), 'std' => '20'))); // add the slider fields for the admin yit_add_slider_config($slider_type, array(array('name' => __('Effect', 'yit'), 'id' => 'effect', 'type' => 'select', 'desc' => __('Select the effect you want for slides transiction.', 'yit'), 'options' => array('vslide' => 'vslide', 'hslide' => 'hslide', 'fade' => 'fade'), 'std' => 'fade'), array('name' => __('How to show the title', 'yit'), 'id' => 'show_caption', 'type' => 'select', 'desc' => __('Define how to show the title in the slide.', 'yit'), 'options' => array('show' => __('Show always', 'yit'), 'onload' => __('Show on load', 'yit'), 'onhover' => __('Show on hover', 'yit')), 'std' => 'onload'), array('name' => __('Pause between slides (s)', 'yit'), 'id' => 'interval', 'type' => 'slider', 'desc' => __('Select the delay between slides, expressed in seconds.', 'yit'), 'min' => 0.1, 'max' => 20, 'step' => 0.1, 'std' => 3), array('name' => __('Animation speed (s)', 'yit'), 'id' => 'speed', 'type' => 'slider', 'desc' => __('The speed of the animation between two slide, expressed in seconds.', 'yit'), 'min' => 0.1, 'max' => 20, 'step' => 0.1, 'std' => 0.8), array('name' => __('Content width', 'yit'), 'id' => 'width', 'type' => 'number', 'desc' => __('Select the width of content (take in mind 22px of padding and border of the slider, so if you want the slider 1200px width, set 1178px as width.).', 'yit'), 'min' => 10, 'max' => 2000, 'std' => 1148), array('name' => __('Content height', 'yit'), 'id' => 'height', 'type' => 'number', 'desc' => __('Select the height of content (take in mind 22px of padding and border of the slider, so if you want the slider 400px height, set 378px as height.).', 'yit'), 'min' => 10, 'max' => 2000, 'std' => 378), array('type' => 'sep'), array('name' => __('Header background color', 'yit'), 'id' => 'header-background', 'type' => 'colorpicker', 'desc' => __('The color of background if the slider is set in header (empty if you want transparent)', 'yit'), 'std' => ''))); // add the slider fields for the admin yit_slider_typography_options($slider_type, array(array('id' => 'tooltip-font', 'type' => 'typography', 'name' => __('Caption font', 'yit'), 'desc' => __('Configure the tooltip text in hover of the slide.', 'yit'), 'min' => 1, 'max' => 72, 'std' => array('size' => 13, 'unit' => 'px', 'family' => 'Play', 'style' => 'regular', 'color' => '#585555'), 'style' => array('selectors' => '.slider-%s.slider.thumbnails .showcase-caption p', 'properties' => 'font-size, font-family, color, font-style, font-weight')), array('id' => 'extra-tooltip-font', 'type' => 'typography', 'name' => __('Tooltip text font', 'yit'), 'desc' => __('Configure the font of the additional tooltip that you add inside the slide in a custom position.', 'yit'), 'min' => 1, 'max' => 72, 'std' => array('size' => 12, 'unit' => 'px', 'family' => 'Muli', 'style' => 'regular', 'color' => '#000'), 'style' => array('selectors' => '.slider-%s.slider.thumbnails div.showcase-tooltip', 'properties' => 'font-size, font-family, color, font-style, font-weight'))));
<?php /** * @package WordPress * @subpackage Your Inspiration Themes */ yit_register_portfolio_style($portfolio_type, 'portfolio-' . $portfolio_type, 'css/style.css'); // add the image size yit_add_image_size('thumb_portfolio_simply', 770, 0, false); // add the slider fields for the admin yit_add_portfolio_config($portfolio_type, array(array('name' => __('Items', 'yit'), 'id' => 'nitems', 'type' => 'number', 'min' => 0, 'max' => 200, 'desc' => __('Select the number of items to show (Only if the filters are disabled). Leave 0 to show all.', 'yit'), 'std' => 0), array('name' => __('Project detail label', 'yit'), 'id' => 'project-label', 'type' => 'text', 'desc' => __('Select the label for project details', 'yit'), 'std' => __('Project Info', 'yit')))); // add support to slide yit_add_work_support($portfolio_type, array(array('name' => __('Background', 'yit'), 'id' => 'background-container', 'type' => 'colorpicker', 'desc' => __('Define the container background color.', 'yit'), 'std' => ''), array('name' => __('Background image', 'yit'), 'id' => 'background-image-container', 'type' => 'upload', 'desc' => __('Define the container background image.', 'yit')), array('name' => __('Background image position', 'yit'), 'id' => 'background-image-container-position', 'type' => 'select', 'options' => array('left top' => __('Left Top', 'yit'), 'left center' => __('Left Center', 'yit'), 'left bottom' => __('Left Bottom', 'yit'), 'right top' => __('Right Top', 'yit'), 'right center' => __('Right Center', 'yit'), 'right bottom' => __('Right Bottom', 'yit'), 'center top' => __('Center Top', 'yit'), 'center center' => __('Center Center', 'yit'), 'center bottom' => __('Center Bottom', 'yit')), 'desc' => __('Define the background image position.', 'yit')), array('name' => __('Background image repeat', 'yit'), 'id' => 'background-image-container-repeat', 'type' => 'select', 'options' => array('no-repeat' => __('No Repeat', 'yit'), 'repeat' => __('Repeat', 'yit'), 'repeat-x' => __('Repeat X', 'yit'), 'repeat-y' => __('Repeat Y', 'yit')), 'desc' => __('Define the container background image.', 'yit')), array('name' => __('Image position', 'yit'), 'id' => 'image-position', 'type' => 'select', 'desc' => __('Define the image position. Leave empty for transparent background', 'yit'), 'std' => 'left', 'options' => array('left' => __('Left', 'yit'), 'right' => __('Right', 'yit'), 'top' => __('Top', 'yit')))));