'Main Menu', ) ); //////////////////////////////////////////////////////////////////// // Register the Sidebar(s) //////////////////////////////////////////////////////////////////// add_action( 'widgets_init', 'blogr_widgets_init' ); function blogr_widgets_init() { register_sidebar( array( 'name' => __('Right Sidebar', 'blogr'), 'id' => 'right-sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar( array( 'name' => __('Left Sidebar', 'blogr'), 'id' => 'left-sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar( array( 'name' => __('Area After First Post', 'blogr'), 'id' => 'post-area', 'description' => __( 'Suitable for text widget.', 'blogr' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); } //////////////////////////////////////////////////////////////////// // Register hook and action to set Main content area col-md- width based on sidebar declarations //////////////////////////////////////////////////////////////////// add_action( 'blogr_main_content_width_hook', 'blogr_main_content_width_columns'); function blogr_main_content_width_columns () { $columns = '12'; if (get_theme_mod( 'rigth-sidebar-check', 1 ) != 0 ) { $columns = $columns - get_theme_mod( 'right-sidebar-size', 3 ); } if (get_theme_mod( 'left-sidebar-check', 0 ) != 0 ) { $columns = $columns - get_theme_mod( 'left-sidebar-size', 3 ); } echo $columns; } function blogr_main_content_width() { do_action('blogr_main_content_width_hook'); } //////////////////////////////////////////////////////////////////// // Add support for a featured image and the size //////////////////////////////////////////////////////////////////// add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size(300,300, true); add_image_size( 'twp-home', 500, 333, true ); add_image_size( 'twp-featured', 832, 300, true ); add_image_size( 'twp-single', 1600, 400, true ); //////////////////////////////////////////////////////////////////// // Adds RSS feed links to for posts and comments. //////////////////////////////////////////////////////////////////// add_theme_support( 'automatic-feed-links' ); //////////////////////////////////////////////////////////////////// // Set Content Width //////////////////////////////////////////////////////////////////// if ( ! isset( $content_width ) ) $content_width = 800; //////////////////////////////////////////////////////////////////// // Schema.org microdata //////////////////////////////////////////////////////////////////// function blogr_tag_schema() { $schema = 'http://schema.org/'; // Is single post if(is_single()) { $type = "Article"; } // Is author page elseif( is_author() ) { $type = 'ProfilePage'; } // Is search results page elseif( is_search() ) { $type = 'SearchResultsPage'; } else { $type = 'WebPage'; } echo 'itemscope itemtype="' . $schema . $type . '"'; } //////////////////////////////////////////////////////////////////// // Breadcrumbs //////////////////////////////////////////////////////////////////// function blogr_breadcrumb() { global $post, $wp_query; // schema link $schema_link = 'http://data-vocabulary.org/Breadcrumb'; $home = __('Home', 'blogr'); $delimiter = ' » '; $homeLink = home_url(); if (is_home() || is_front_page()) { // no need for breadcrumbs in homepage } else { echo ''; } } //////////////////////////////////////////////////////////////////// // Display navigation to next/previous pages when applicable //////////////////////////////////////////////////////////////////// if ( ! function_exists( 'blogr_content_nav' ) ) : function blogr_content_nav( $nav_id ) { global $wp_query, $post; // Don't print empty markup on single pages if there's nowhere to navigate. if ( is_single() ) { $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; } // Don't print empty markup in archives if there's only one page. if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) return; $nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation'; ?> __( 'Facebook', 'blogr' ), 'twp_social_twitter' => __( 'Twitter', 'blogr' ), 'twp_social_google' => __( 'Google-Plus' , 'blogr' ), 'twp_social_instagram' => __( 'Instagram', 'blogr' ), 'twp_social_pin' => __( 'Pinterest', 'blogr' ), 'twp_social_youtube' => __( 'YouTube', 'blogr' ), 'twp_social_reddit' => __( 'Reddit', 'blogr' ), ); ?> str_replace($big, '%#%', esc_url(get_pagenum_link($big))), 'format' => '?page=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $wp_query->max_num_pages, 'prev_next' => false, 'type' => 'array', 'prev_next' => TRUE, 'prev_text' => __('← Previous', 'blogr' ), 'next_text' => __('Next →', 'blogr' ), )); if (is_array($pages)) { $current_page = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged'); echo ''; } } ?>