1920, 'height' => 100, 'flex-width' => true, 'flex-height' => true, 'uploads' => true, 'header-text' => true, 'default-text-color' => 'fff', 'wp-head-callback' => 'city_informer_header_style', ); add_theme_support( 'custom-header', $args ); /* Adds RSS feed links to for posts and comments. */ add_theme_support( 'automatic-feed-links' ); /* Styles the visual editor with editor-style.css */ add_editor_style(); /* Styles for default background arguments */ $background_args = array ( 'default-color' => 'e3e3e3', 'default-image' => get_template_directory_uri() . '/images/background.jpg', ); add_theme_support( 'custom-background', $background_args ); /* Register navigation menu */ register_nav_menus ( array( 'header-menu' => 'Main Menu' ) ); /* set content width */ if ( ! isset( $content_width ) ) $content_width = 620; } /* title filter */ function city_informer_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; /* Add the site name. */ $site_title = get_bloginfo( 'name' ); /* Add the site description for the home/front page. */ $site_description = get_bloginfo( 'description', 'display' ); $sep = '«'; if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$site_title $sep $site_description"; /* Add a page number if necessary. */ if ( 2 <= $paged || 2 <= $page ) $title = "$title $sep " . sprintf( __( 'Page', 'city_informer' ) . ' %s', max( $paged, $page ) ); return $title; } /* Registers main widget area */ function city_informer_register_widget() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'city_informer' ), 'id' => 'sidebar-widgets', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } /*********************************** FOR SLIDER ****************/ /* adding metabox for show post in slider */ function city_informer_metabox_for_slider() { add_meta_box( 'city_informer_metabox_id', __( 'Add to slider' , 'city_informer' ), 'city_informer_metabox_for_slider_callback', 'post', 'normal' ); } /* add and save meta for post */ function city_informer_save_post_meta_for_slider( $post_id ) { global $post, $post_id; /* autosave meta for post */ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return $post_id; elseif ( ! current_user_can( 'edit_post', $post_id ) ) { return $post_id; } /* save meta for post */ if ( wp_is_post_revision( $post_id ) ) return $post_id; if ( $post != null ) { if ( ( isset ( $_POST['city_informer_add_slide'] ) ) && ( $_POST['city_informer_add_slide'] == 'on' ) ) { update_post_meta( $post->ID, 'city_informer_add_slide', 'on' ); } else { update_post_meta( $post->ID, 'city_informer_add_slide', 'off' ); } } } //customize metabox function city_informer_metabox_for_slider_callback() { global $post; $screen = get_current_screen(); // Add form elements for metabox ?> ID, 'city_informer_add_slide', true ) ) { ?> checked='checked' /> $length ) ? mb_substr( $excerpt, 0, $length ) . '...' : $excerpt; return $excerpt; } /********************************END FOR SLIDER ****************/ /* register scripts and styles */ function city_informer_scripts_styles() { // load css wp_enqueue_style( 'city_informer_styles', get_stylesheet_uri() ); // load js scripts wp_enqueue_script( 'city_informer_script', get_template_directory_uri().'/js/script.js', array( 'jquery' ), null, false ); wp_enqueue_script( 'city_informer_script_slider', get_template_directory_uri().'/js/slider.js', array( 'jquery' ), null, false ); wp_enqueue_script( 'city_informer_script_fileinput', get_template_directory_uri().'/js/fileinput.js', array( 'jquery' ), null, false ); wp_enqueue_script( 'city_informer_script_selectbox', get_template_directory_uri().'/js/selectbox.js', array( 'jquery' ), null, false ); // load styles for ie wp_enqueue_style( 'city_informer_style_ie', get_template_directory_uri() . "/styles/ie78.css" ); wp_style_add_data( 'city_informer_style_ie', 'conditional', 'lt IE 9' ); // load script for comment-reply if ( is_singular() ) wp_enqueue_script( "comment-reply" ); /* Loads selectivizr JavaScript file to add support for newest css pseudoclasses. */ wp_enqueue_script( 'trvlplnt-pseudoclasses-script', get_template_directory_uri() . '/js/selectivizr-min.js', array( 'jquery' ) ); /* Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. */ wp_enqueue_script( 'trvlplnt-support-script', get_template_directory_uri() . '/js/html5.js', array( 'jquery' ) ); } // custom header function city_informer_header_style() { $text_color = get_header_textcolor(); $display_text = display_header_text(); if ( $text_color == HEADER_TEXTCOLOR )/* If no custom options for text are set, return default. */ return; /* If optins are set, we use them */ ?> '; // tag before the current crumb $after = ''; // tag after the current crumb $text['home'] = __( 'Home', 'city_informer' ); /* Link text "Home" */ $text['category'] = __( 'Category:', 'city_informer' ) . ' %s'; /* Text for a category page */ $text['search'] = __( 'Results for:', 'city_informer' ) . ' %s'; /* Text for the search results page */ $text['tag'] = __( 'Tags:', 'city_informer' ) . ' %s'; /* Text for the tag page */ $text['author'] = __( 'Autors posts:', 'city_informer' ) . ' %s'; /* Text for the autor page */ $text['404'] = __( 'Error 404', 'city_informer' ); /* Text for the page 404 */ $home_link = home_url(); // code for generate breadcrumbs if ( is_home() || is_front_page() ) { if ( $show_on_home == 1 ) echo ''; } else { echo ''; } } // end city_informer_breadcrumbs // Post caption for thumbnail function city_informer_the_post_caption( $size = '', $attr = '' ) { global $post; $thumb_id = get_post_thumbnail_id( $post->ID ); $args = array( 'post_type' => 'attachment', 'post_status' => null, 'parent' => $post->ID, 'include' => $thumb_id, ); $thumbnail_image = get_posts( $args ); if ( $thumb_id && $thumbnail_image && isset( $thumbnail_image[0] ) ) { // Showing the thumbnail caption $caption = $thumbnail_image[0]->post_excerpt; if( $caption ) { $output = '

'; $output .= $caption; $output .= '

'; echo $output; }; }; } /* Show pages navigation */ function city_informer_page_nav() { if ( get_previous_posts_link() || get_next_posts_link() ) { /* div for navigation */?> <?php wp_title( '|', true, 'right' ); ?>