'ffffff', 'text' => '333333', 'link' => '1b8be0', 'border' => 'eeeeee', 'url' => '71baf1', ); /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus( array( 'primary' => __( 'Primary Menu', 'blogster' ), ) ); /** * Add default posts and comments RSS feed links to head */ add_theme_support( 'automatic-feed-links' ); /** * Add support for an Aside Post Format */ add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote' ) ); /** * Add support for custom backgrounds */ add_custom_background(); // This theme uses Feature Images for per-post/per-page Custom Header images add_theme_support( 'post-thumbnails' ); /** * Add support for Custom Headers */ define( 'HEADER_TEXTCOLOR', '000' ); // No CSS, just an IMG call. The %s is a placeholder for the theme template directory URI. define( 'HEADER_IMAGE', '%s/images/headers/default.jpg' ); // 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 blogster_header_image_width and blogster_header_image_height to change these values. define( 'HEADER_IMAGE_WIDTH', apply_filters( 'blogster_header_image_width', 1000 ) ); define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'blogster_header_image_height', 300 ) ); // 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 ); // Add a way for the custom header to be styled in the admin panel that controls // custom headers. See blogster_admin_header_style(), below. add_custom_image_header( 'blogster_header_style', 'blogster_admin_header_style', 'blogster_admin_header_image' ); // ... and thus ends the changeable header business. if ( ! function_exists( 'blogster_header_style' ) ) : /** * Styles the header image and text displayed on the blog * * @since blogster 1.0 */ function blogster_header_style() { // If no custom options for text are set, let's bail // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value if ( HEADER_TEXTCOLOR == get_header_textcolor() ) return; // If we get this far, we have custom styles. Let's do this. ?> Header admin panel. * * Referenced via add_custom_image_header() in blogster_setup(). * * @since blogster 1.0 */ function blogster_admin_header_style() { ?> Header admin panel. * * Referenced via add_custom_image_header() in blogster_setup(). * * @since blogster 1.0 */ function blogster_admin_header_image() { ?>

onclick="return false;" href="">

>
' . __( 'Continue reading ', 'blogster' ) . ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and blogster_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. */ function blogster_auto_excerpt_more( $more ) { return ' …' . blogster_continue_reading_link(); } add_filter( 'excerpt_more', 'blogster_auto_excerpt_more' ); /** * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. */ function blogster_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= blogster_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'blogster_custom_excerpt_more' ); /** * Add blogster's custom image sizes */ add_image_size( 'large-feature', HEADER_IMAGE_WIDTH, 500, true ); // Used for large feature images add_image_size( 'small-feature', 500, 500 ); // Used for featured posts if a large-feature doesn't exist /** * Add custom body classes */ function blogster_body_class($classes) { if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) ) $classes[] = 'singular'; return $classes; } add_filter( 'body_class', 'blogster_body_class' ); /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. */ function blogster_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'blogster_page_menu_args' ); /** * Register widgetized area and update sidebar with default widgets */ function blogster_widgets_init() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'blogster' ), 'id' => 'sidebar-1', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Showcase Sidebar', 'blogster' ), 'id' => 'sidebar-2', 'description' => __( 'The sidebar for the optional Showcase Template', 'blogster' ), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Area One', 'blogster' ), 'id' => 'sidebar-3', 'description' => __( 'An optional widget area for your site footer', 'blogster' ), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Area Two', 'blogster' ), 'id' => 'sidebar-4', 'description' => __( 'An optional widget area for your site footer', 'blogster' ), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Area Three', 'blogster' ), 'id' => 'sidebar-5', 'description' => __( 'An optional widget area for your site footer', 'blogster' ), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Area Four', 'blogster' ), 'id' => 'sidebar-6', 'description' => __( 'An optional widget area for your site footer', 'blogster' ), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'init', 'blogster_widgets_init' ); /** * Grab blogster's Custom Widgets */ require( dirname( __FILE__ ) . '/inc/widgets.php' ); /** * Display navigation to next/previous pages when applicable */ function blogster_content_nav($nav_id) { global $wp_query; if ( $wp_query->max_num_pages > 1 ) : ?> /i', $post->post_content, $matches); $first_url = $matches [1] [0]; if ( empty( $first_url ) ) return false; return $first_url; } /** * Count the number of footer sidebars to enable dynamic classes for the footer */ function blogster_footer_sidebar_class() { $count = 0; if ( is_active_sidebar( 'sidebar-3' ) ) $count++; if ( is_active_sidebar( 'sidebar-4' ) ) $count++; if ( is_active_sidebar( 'sidebar-5' ) ) $count++; if ( is_active_sidebar( 'sidebar-6' ) ) $count++; switch ( $count ) { case '1': $class = 'one'; break; case '2': $class = 'two'; break; case '3': $class = 'three'; break; case '4': $class = 'four'; break; default: $class = ''; break; } if ( '' != $class ) echo 'class="' . $class . '"'; } if ( ! function_exists( 'blogster_comment' ) ) : /** * Template for comments and pingbacks. * * To override this walker in a child theme without modifying the comments template * simply create your own blogster_comment(), and that function will be used instead. * * Used as a callback by wp_list_comments() for displaying the comments. * * @since blogster 0.4 */ function blogster_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '' : ?>
  • id="li-comment-">
    comment_parent ) $avatar_size = 39; echo get_avatar( $comment, $avatar_size ); printf( __( '%1$s on %2$s%3$s at %4$s%5$s said:', 'blogster' ), sprintf( '%s', get_comment_author_link() ), '' ); ?>
    comment_approved == '0' ) : ?>
    __( 'Reply ↓', 'blogster' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  • '

    ', 'suffix' => '

    ', 'title' => __( ' ', 'df-breadcrumb' ), 'home' => __( 'Home', 'df-breadcrumb' ), 'separator' => '»', 'front_page' => false, 'show_blog' => false, 'singular_post_taxonomy' => 'category', 'echo' => true ); $args = apply_filters( 'df_breadcrumb_args', $args ); $args = wp_parse_args( $args, $defaults ); if ( is_front_page() && !$args['front_page'] ) return apply_filters( 'df_breadcrumb', false ); /* Format the title. */ $title = ( !empty( $args['title'] ) ? '' . $args['title'] . '': '' ); $separator = ( !empty( $args['separator'] ) ) ? "{$args['separator']}" : "/"; /* Get the items. */ $items = df_breadcrumb_get_items( $args ); $breadcrumbs = ''; $breadcrumbs = apply_filters( 'df_breadcrumb', $breadcrumbs ); if ( !$args['echo'] ) return $breadcrumbs; else echo $breadcrumbs; } /** * Gets the items for the DF Breadcrumb. * * @since 0.4 */ function df_breadcrumb_get_items( $args ) { global $wp_query; $item = array(); $show_on_front = get_option( 'show_on_front' ); /* Front page. */ if ( is_front_page() ) { $item['last'] = $args['home']; } /* Link to front page. */ if ( !is_front_page() ) $item[] = '' . $args['home'] . ''; /* If bbPress is installed and we're on a bbPress page. */ if ( function_exists( 'is_bbpress' ) && is_bbpress() ) $item = array_merge( $item, df_breadcrumb_get_bbpress_items() ); /* If viewing a home/post page. */ elseif ( is_home() ) { $home_page = get_page( $wp_query->get_queried_object_id() ); $item = array_merge( $item, df_breadcrumb_get_parents( $home_page->post_parent ) ); $item['last'] = get_the_title( $home_page->ID ); } /* If viewing a singular post. */ elseif ( is_singular() ) { $post = $wp_query->get_queried_object(); $post_id = (int) $wp_query->get_queried_object_id(); $post_type = $post->post_type; $post_type_object = get_post_type_object( $post_type ); if ( 'post' === $wp_query->post->post_type && $args['show_blog'] ) { $item[] = '' . get_the_title( get_option( 'page_for_posts' ) ) . ''; } if ( 'page' !== $wp_query->post->post_type ) { /* If there's an archive page, add it. */ if ( function_exists( 'get_post_type_archive_link' ) && !empty( $post_type_object->has_archive ) ) $item[] = '' . $post_type_object->labels->name . ''; if ( isset( $args["singular_{$wp_query->post->post_type}_taxonomy"] ) && is_taxonomy_hierarchical( $args["singular_{$wp_query->post->post_type}_taxonomy"] ) ) { $terms = wp_get_object_terms( $post_id, $args["singular_{$wp_query->post->post_type}_taxonomy"] ); $item = array_merge( $item, df_breadcrumb_get_term_parents( $terms[0], $args["singular_{$wp_query->post->post_type}_taxonomy"] ) ); } elseif ( isset( $args["singular_{$wp_query->post->post_type}_taxonomy"] ) ) $item[] = get_the_term_list( $post_id, $args["singular_{$wp_query->post->post_type}_taxonomy"], '', ', ', '' ); } if ( ( is_post_type_hierarchical( $wp_query->post->post_type ) || 'attachment' === $wp_query->post->post_type ) && $parents = df_breadcrumb_get_parents( $wp_query->post->post_parent ) ) { $item = array_merge( $item, $parents ); } $item['last'] = get_the_title(); } /* If viewing any type of archive. */ else if ( is_archive() ) { if ( is_category() || is_tag() || is_tax() ) { $term = $wp_query->get_queried_object(); $taxonomy = get_taxonomy( $term->taxonomy ); if ( ( is_taxonomy_hierarchical( $term->taxonomy ) && $term->parent ) && $parents = df_breadcrumb_get_term_parents( $term->parent, $term->taxonomy ) ) $item = array_merge( $item, $parents ); $item['last'] = $term->name; } else if ( function_exists( 'is_post_type_archive' ) && is_post_type_archive() ) { $post_type_object = get_post_type_object( get_query_var( 'post_type' ) ); $item['last'] = $post_type_object->labels->name; } else if ( is_date() ) { if ( is_day() ) $item['last'] = __( 'Archives for ', 'df-breadcrumb' ) . get_the_time( 'F j, Y' ); elseif ( is_month() ) $item['last'] = __( 'Archives for ', 'df-breadcrumb' ) . single_month_title( ' ', false ); elseif ( is_year() ) $item['last'] = __( 'Archives for ', 'df-breadcrumb' ) . get_the_time( 'Y' ); } else if ( is_author() ) $item['last'] = __( 'Archives by: ', 'df-breadcrumb' ) . get_the_author_meta( 'display_name', $wp_query->post->post_author ); } /* If viewing search results. */ else if ( is_search() ) $item['last'] = __( 'Search results for "', 'df-breadcrumb' ) . stripslashes( strip_tags( get_search_query() ) ) . '"'; /* If viewing a 404 error page. */ else if ( is_404() ) $item['last'] = __( 'Page Not Found', 'df-breadcrumb' ); return apply_filters( 'df_breadcrumb_items', $item ); } /** * Gets the items for the breadcrumb item if bbPress is installed. * * @since 0.4 * * @param array $args Mixed arguments for the menu. * @return array List of items to be shown in the item. */ function df_breadcrumb_get_bbpress_items( $args = array() ) { $item = array(); $post_type_object = get_post_type_object( bbp_get_forum_post_type() ); if ( !empty( $post_type_object->has_archive ) && !bbp_is_forum_archive() ) $item[] = '' . bbp_get_forum_archive_title() . ''; if ( bbp_is_forum_archive() ) $item[] = bbp_get_forum_archive_title(); elseif ( bbp_is_topic_archive() ) $item[] = bbp_get_topic_archive_title(); elseif ( bbp_is_single_view() ) $item[] = bbp_get_view_title(); elseif ( bbp_is_single_topic() ) { $topic_id = get_queried_object_id(); $item = array_merge( $item, df_breadcrumb_get_parents( bbp_get_topic_forum_id( $topic_id ) ) ); if ( bbp_is_topic_split() || bbp_is_topic_merge() || bbp_is_topic_edit() ) $item[] = '' . bbp_get_topic_title( $topic_id ) . ''; else $item[] = bbp_get_topic_title( $topic_id ); if ( bbp_is_topic_split() ) $item[] = __( 'Split', 'df-breadcrumb' ); elseif ( bbp_is_topic_merge() ) $item[] = __( 'Merge', 'df-breadcrumb' ); elseif ( bbp_is_topic_edit() ) $item[] = __( 'Edit', 'df-breadcrumb' ); } elseif ( bbp_is_single_reply() ) { $reply_id = get_queried_object_id(); $item = array_merge( $item, df_breadcrumb_get_parents( bbp_get_reply_topic_id( $reply_id ) ) ); if ( !bbp_is_reply_edit() ) { $item[] = bbp_get_reply_title( $reply_id ); } else { $item[] = '' . bbp_get_reply_title( $reply_id ) . ''; $item[] = __( 'Edit', 'df-breadcrumb' ); } } elseif ( bbp_is_single_forum() ) { $forum_id = get_queried_object_id(); $forum_parent_id = bbp_get_forum_parent( $forum_id ); if ( 0 !== $forum_parent_id) $item = array_merge( $item, df_breadcrumb_get_parents( $forum_parent_id ) ); $item[] = bbp_get_forum_title( $forum_id ); } elseif ( bbp_is_single_user() || bbp_is_single_user_edit() ) { if ( bbp_is_single_user_edit() ) { $item[] = '' . bbp_get_displayed_user_field( 'display_name' ) . ''; $item[] = __( 'Edit' ); } else { $item[] = bbp_get_displayed_user_field( 'display_name' ); } } return apply_filters( 'df_breadcrumb_get_bbpress_items', $item, $args ); } /** * Gets parent pages of any post type. * * @since 0.1 * @param int $post_id ID of the post whose parents we want. * @param string $separator. * @return string $html String of parent page links. */ function df_breadcrumb_get_parents( $post_id = '', $separator = '/' ) { $parents = array(); if ( $post_id == 0 ) return $parents; while ( $post_id ) { $page = get_page( $post_id ); $parents[] = '' . get_the_title( $post_id ) . ''; $post_id = $page->post_parent; } if ( $parents ) $parents = array_reverse( $parents ); return $parents; } /** * Searches for term parents of hierarchical taxonomies. * * @since 0.1 * @param int $parent_id The ID of the first parent. * @param object|string $taxonomy The taxonomy of the term whose parents we want. * @return string $html String of links to parent terms. */ function df_breadcrumb_get_term_parents( $parent_id = '', $taxonomy = '', $separator = '/' ) { $html = array(); $parents = array(); if ( empty( $parent_id ) || empty( $taxonomy ) ) return $parents; while ( $parent_id ) { $parent = get_term( $parent_id, $taxonomy ); $parents[] = '' . $parent->name . ''; $parent_id = $parent->parent; } if ( $parents ) $parents = array_reverse( $parents ); return $parents; } //Ending df_breadcrumgs() //Starting Pagination function df_pagination($pages = '', $range = 2) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "\n"; } } //Ending Pagination