PATH:
var
/
www
/
vhosts
/
sandbox.dos-group.com
/
httpdocs
/
hotelcoronado
/
wp-content
/
themes
/
hotelcoronado
<?php /* ----------------------------------- ** SET SOME CONSTANT ** -------------------------------------- */ define( 'THEMEPATH', get_template_directory() ); define( 'THEMEURI', get_template_directory_uri() ); define( 'IMAGES', get_template_directory_uri() . '/images' ); define( 'PLUGINS', ABSPATH . 'wp-content/plugins' ); require_once( THEMEPATH . '/admin/cuztom.php' ); add_query_arg( array('page') ); /* ----------------------------------- ** REGISTER THEME FEATURES ** -------------------------------------- */ if ( ! function_exists('hc_theme_features') ) { // Register Theme Features function hc_theme_features() { // Add theme support for Featured Images add_theme_support( 'post-thumbnails', array( 'post', 'page', 'packages' ) ); // Add theme support for Custom Background $background_args = array( 'default-color' => 'ffffff', 'default-image' => '', ); add_theme_support( 'custom-background', $background_args ); // Add theme support for Translation load_theme_textdomain( 'hotel-coronado', get_template_directory() . '/language' ); load_theme_textdomain('quitenicebooking', PLUGINS . '/quitenicebooking/languages'); } // Hook into the 'after_setup_theme' action add_action( 'after_setup_theme', 'hc_theme_features' ); } if ( ! isset( $content_width ) ) $content_width = 1200; /* ----------------------------------- ** REGISTER THEME STYLES AND SCRIPTS ** -------------------------------------- */ // Register Style function hc_load_styles() { wp_register_style( 'bootstrap', THEMEURI . '/css/bootstrap.min.css', false, '3.0.3' ); wp_enqueue_style( 'bootstrap' ); wp_register_style( 'base', THEMEURI . '/css/base.css', array( 'bootstrap' ), '1.0' ); wp_enqueue_style( 'base' ); wp_register_style( 'awesome', THEMEURI . '/css/font-awesome.min.css', array( 'bootstrap', 'base' ), '4.0.3' ); wp_enqueue_style( 'awesome' ); wp_register_style( 'fancy', THEMEURI . '/css/fancybox.min.css', array( ), '2.1.5' ); if ( is_page() ) wp_enqueue_style( 'fancy' ); } // Hook into the 'wp_enqueue_styles' action add_action( 'wp_enqueue_scripts', 'hc_load_styles' ); // Register Script function hc_load_scripts() { wp_register_script( 'bootstrap', THEMEURI . '/js/bootstrap.min.js', array( 'jquery' ), '3.0.3', true ); wp_enqueue_script( 'bootstrap' ); wp_register_script( 'custom', THEMEURI . '/js/custom.js', array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'custom' ); wp_register_script( 'lazy', THEMEURI . '/js/lazyload.min.js', array( 'jquery' ), '1.9.3', true ); wp_enqueue_script( 'lazy' ); wp_register_script( 'anystrech', THEMEURI . '/js/anystretch.min.js', array( 'jquery' ), '1.2', true ); wp_enqueue_script( 'anystrech' ); wp_register_script( 'fancy', THEMEURI . '/js/fancybox.pack.js', array( 'jquery' ), '2.1.5', true ); if ( is_page() ) wp_enqueue_script( 'fancy' ); wp_register_script( 'googlemap', 'http://maps.google.com/maps/api/js?sensor=false', false, '1.0', false ); if (is_front_page()) wp_enqueue_script( 'googlemap' ); } // Hook into the 'wp_enqueue_scripts' action add_action( 'wp_enqueue_scripts', 'hc_load_scripts' ); /* ----------------------------------- ** MEDIA QUERIES AND IE MODERNIZR ** -------------------------------------- */ function stupid_ie_hacks() { ?> <?php } add_action('wp_footer','stupid_ie_hacks'); function stupid_ie_css_hacks() { ?> <!--[if lt IE 9]> <link rel='stylesheet' media="all" href='<?php echo THEMEURI . '/css/ie8.css' ?>' /> <![endif]--> <?php } add_action('wp_head','stupid_ie_css_hacks'); /* ----------------------------------- ** FIRE SOME SCRIPTS ** -------------------------------------- */ /* ----------------------------------- ** MENU ** -------------------------------------- */ if ( ! function_exists( 'hc_navigation_menus' ) ) { // Register Navigation Menus function hc_navigation_menus() { $locations = array( 'main-nav' => __( 'Menu principale', 'hotel-coronado' ), ); register_nav_menus( $locations ); } // Hook into the 'init' action add_action( 'init', 'hc_navigation_menus' ); } /* ----------------------------------- ** SIDEBARS ** -------------------------------------- */ if ( ! function_exists( 'language_sidebar' ) ) { // Register Sidebar function hc_sidebars() { $argsLanguageSb = array( 'id' => 'language-sb', 'name' => __( 'Selettore lingua', 'coronado' ), 'description' => __( 'Spazio dedicato alla widget per la selezione della lingua', 'coronado' ), 'class' => 'language-selector', ); register_sidebar( $argsLanguageSb ); $argsPageSb = array( 'id' => 'pages-sb', 'name' => __( 'Sidebar pagine', 'coronado' ), 'description' => __( 'Spazio dedicato ai widget per le pagine', 'coronado' ), 'class' => 'right-page-sidebar', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgettitle text-right not-top">', 'after_title' => '</h3>' ); register_sidebar( $argsPageSb ); $booking = array( 'id' => 'booking-sb', 'name' => __( 'Sidebar booking', 'coronado' ), 'description' => __( 'Spazio dedicato al widget per il booking', 'coronado' ), 'class' => 'booking-sidebar', 'before_widget' => '<div class="home-reservation-box clearfix">', 'after_widget' => '</div>', 'before_title' => '<h5 class="widgettitle not-top booking-title">', 'after_title' => '</h5>' ); register_sidebar( $booking ); $footer1 = array( 'id' => 'footer1-sb', 'name' => __( 'Sidebar footer col1', 'coronado' ), 'description' => __( 'Spazio dedicato al widget per la prima colonna del footer', 'coronado' ), 'class' => 'footer-sidebar', 'before_widget' => '<div id="%1$s" class="col-sm-3 %2$s footer-col">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widgettitle not-top">', 'after_title' => '</h3>' ); register_sidebar( $footer1 ); $footer2 = array( 'id' => 'footer2-sb', 'name' => __( 'Sidebar footer col2', 'coronado' ), 'description' => __( 'Spazio dedicato al widget per la seconda colonna del footer', 'coronado' ), 'class' => 'footer-sidebar', 'before_widget' => '<div id="%1$s" class="col-sm-3 %2$s footer-col">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widgettitle not-top">', 'after_title' => '</h3>' ); register_sidebar( $footer2 ); $footer3 = array( 'id' => 'footer3-sb', 'name' => __( 'Sidebar footer col3', 'coronado' ), 'description' => __( 'Spazio dedicato al widget per la terza colonna del footer', 'coronado' ), 'class' => 'footer-sidebar', 'before_widget' => '<div id="%1$s" class="col-sm-3 %2$s footer-col">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widgettitle not-top">', 'after_title' => '</h3>' ); register_sidebar( $footer3 ); $footer4 = array( 'id' => 'footer4-sb', 'name' => __( 'Sidebar footer col4', 'coronado' ), 'description' => __( 'Spazio dedicato al widget per la quarta colonna del footer', 'coronado' ), 'class' => 'footer-sidebar', 'before_widget' => '<div id="%1$s" class="col-sm-3 %2$s footer-col">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widgettitle not-top">', 'after_title' => '</h3>' ); register_sidebar( $footer4 ); } // Hook into the 'widgets_init' action add_action( 'widgets_init', 'hc_sidebars' ); } $pages = new Cuztom_Post_Type('page'); $pages->add_meta_box( 'featured_image_options', 'Opzioni', array( array( 'name' => 'image_pos', 'label' => __('Posizione dell\'immagine','hotel-coronado'), 'description' => '', 'type' => 'select', 'options' => array( 'top' => 'Top', 'center' => 'Center', 'bottom' => 'Bottom' ), 'default_value' => 'center' ) ), 'side' ); /* ----------------------------------- ** CUSTOM POST TYPES ** -------------------------------------- */ if ( ! function_exists('hc_packages') ) { // Register Custom Post Type function hc_packages() { $labels = array( 'name' => _x( 'Pacchetti', 'Post Type General Name', 'coronado' ), 'singular_name' => _x( 'Pacchetto', 'Post Type Singular Name', 'coronado' ), 'menu_name' => __( 'Pacchetti', 'coronado' ), 'parent_item_colon' => __( 'Genitore pacchetto:', 'coronado' ), 'all_items' => __( 'Tutti i pacchetti', 'coronado' ), 'view_item' => __( 'Visualizza pacchetto', 'coronado' ), 'add_new_item' => __( 'Aggiungi un nuovo pacchetto', 'coronado' ), 'add_new' => __( 'Aggiungi nuovo', 'coronado' ), 'edit_item' => __( 'Modifica pacchetto', 'coronado' ), 'update_item' => __( 'Aggiorna pacchetto', 'coronado' ), 'search_items' => __( 'Cerca pacchetto', 'coronado' ), 'not_found' => __( 'Non trovato', 'coronado' ), 'not_found_in_trash' => __( 'Non trovato nel cestino', 'coronado' ), ); $args = array( 'label' => __( 'post_type', 'coronado' ), 'description' => __( 'Pacchetti', 'coronado' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', ), 'taxonomies' => array( 'tipologie' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 20, 'menu_icon' => THEMEURI . '/admin/images/shared/special-offer.png', 'can_export' => false, 'has_archive' => false, 'exclude_from_search' => true, 'publicly_queryable' => true, 'query_var' => '', 'capability_type' => 'page', ); register_post_type( 'packages', $args ); } // Hook into the 'init' action add_action( 'init', 'hc_packages', 0 ); } /* ----------------------------------- ** TAXONOMIES ** -------------------------------------- */ if ( ! function_exists( 'hc_pack_taxonomy' ) ) { // Register Custom Taxonomy function hc_pack_taxonomy() { $labels = array( 'name' => _x( 'Tipologie', 'Taxonomy General Name', 'coronado' ), 'singular_name' => _x( 'Tipologia', 'Taxonomy Singular Name', 'coronado' ), 'menu_name' => __( 'Tipologie', 'coronado' ), 'all_items' => __( 'Tipologie', 'coronado' ), 'parent_item' => __( 'Genitore tipologia', 'coronado' ), 'parent_item_colon' => __( 'Genitore', 'coronado' ), 'new_item_name' => __( 'Nuova tipologia', 'coronado' ), 'add_new_item' => __( 'Aggiungi nuovo', 'coronado' ), 'edit_item' => __( 'Modifica tipologia', 'coronado' ), 'update_item' => __( 'Aggiorna tipologia', 'coronado' ), 'separate_items_with_commas' => __( 'Separate items with commas', 'coronado' ), 'search_items' => __( 'Search Items', 'coronado' ), 'add_or_remove_items' => __( 'Aggiungi o rimuovi elementi', 'coronado' ), 'choose_from_most_used' => __( 'Scegli tra le più usate', 'coronado' ), 'not_found' => __( 'Not Found', 'coronado' ), ); $args = array( 'labels' => $labels, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => true, ); register_taxonomy( 'tipologie', 'packages', $args ); } // Hook into the 'init' action add_action( 'init', 'hc_pack_taxonomy', 0 ); } /* ----------------------------------- ** PAGINATION ** -------------------------------------- */ function paginate() { global $wp_query, $wp_rewrite; $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; $pagination = array( 'base' => @add_query_arg('page','%#%'), 'format' => '', 'total' => $wp_query->max_num_pages, 'current' => $current, 'show_all' => true, 'type' => 'plain' ); if ( $wp_rewrite->using_permalinks() ) $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' ); if ( !empty($wp_query->query_vars['s']) ) $pagination['add_args'] = array( 's' => get_query_var( 's' ) ); echo paginate_links( $pagination ); } /* ----------------------------------- ** REWRITE SLUG FOR CUSTOM TAXONOMY ** -------------------------------------- */ function taxonomy_slug_rewrite($wp_rewrite) { $rules = array(); // get all custom taxonomies $taxonomies = get_taxonomies(array('_builtin' => false), 'objects'); // get all custom post types $post_types = get_post_types(array('public' => true, '_builtin' => false), 'objects'); foreach ($post_types as $post_type) { foreach ($taxonomies as $taxonomy) { // go through all post types which this taxonomy is assigned to foreach ($taxonomy->object_type as $object_type) { // check if taxonomy is registered for this custom type if ($object_type == $post_type->rewrite['slug']) { // get category objects $terms = get_categories(array('type' => $object_type, 'taxonomy' => $taxonomy->name, 'hide_empty' => 0)); // make rules foreach ($terms as $term) { $rules[$object_type . '/' . $term->slug . '/?$'] = 'index.php?' . $term->taxonomy . '=' . $term->slug; } } } } } // merge with global rules $wp_rewrite->rules = $rules + $wp_rewrite->rules; } add_filter('generate_rewrite_rules', 'taxonomy_slug_rewrite'); /* ----------------------------------- ** ADMIN ** -------------------------------------- */ require_once dirname(__FILE__) . '/admin/init.php'; /* ----------------------------------- ** NEX GEN GALLERY CUSTOMIZATION ** -------------------------------------- */ function nggGetGallery( $galleryID, $template = '', $images = false ) { global $nggRewrite; $ngg_options = nggGallery::get_option('ngg_options'); //Set sort order value, if not used (upgrade issue) $ngg_options['galSort'] = ($ngg_options['galSort']) ? $ngg_options['galSort'] : 'pid'; $ngg_options['galSortDir'] = ($ngg_options['galSortDir'] == 'DESC') ? 'DESC' : 'ASC'; // get gallery values $picturelist = nggdb::get_gallery($galleryID, $ngg_options['galSort'], $ngg_options['galSortDir']); return $picturelist; }
[-] tmpl-homepage.php
[open]
[+]
images
[-] taxonomy-tipologie.php
[open]
[+]
css
[-] tmpl-ubicazione.php
[open]
[-] functions.php
[open]
[+]
..
[-] packages.php
[open]
[-] single.php
[open]
[+]
js
[+]
partials
[+]
admin
[-] page.php
[open]
[-] footer.php
[open]
[-] archive.php
[open]
[-] header.php
[open]
[+]
fonts
[-] screenshot.png
[open]
[-] loop-archive.php
[open]
[-] index.php
[open]
[-] tmpl-booking.php
[open]
[-] style.css
[open]