'Three Widget Container', 'id' => 'container-one-widget', 'description' => 'Three Widget Container Area', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
' )); register_sidebar(array( 'name' => 'Four Widget Container', 'id' => 'container-two-widget', 'description' => 'Four Widget Container Area', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
' )); register_sidebar(array( 'name' => 'Five Widget Container', 'id' => 'container-three-widget', 'description' => 'Five Widget Container Area', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
' )); register_sidebar(array( 'name' => 'Six Widget Container', 'id' => 'container-four-widget', 'description' => 'Six Widget Container Area' , 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => 'Footer Widgets', 'id' => 'footer-widgets', 'description' => 'Footer Widgets Area', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => __('Right Hand Sidebar', 'business_guru') , 'id' => 'sidebar', 'description' => __('Widgets in this area will be shown on the right-hand side.', 'business_guru') , 'before_title' => '

', 'after_title' => '

', 'before_widget' => '
', 'after_widget' => '
' )); } add_action( 'widgets_init', 'bguru_widgets_init'); /* PAGE NAVIGATION */ if ( ! function_exists( 'bguru_paging_nav' ) ) : /** * Display navigation to next/previous set of posts when applicable. * Based on paging nav function from Twenty Fourteen */ function bguru_paging_nav() { // Don't print empty markup if there's only one page. if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { return; } $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; $pagenum_link = html_entity_decode( get_pagenum_link() ); $query_args = array(); $url_parts = explode( '?', $pagenum_link ); if ( isset( $url_parts[1] ) ) { wp_parse_str( $url_parts[1], $query_args ); } $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%'; // Set up paginated links. $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $GLOBALS['wp_query']->max_num_pages, 'current' => $paged, 'mid_size' => 3, 'add_args' => array_map( 'urlencode', $query_args ), 'prev_text' => __( '← Previous', 'businessguru' ), 'next_text' => __( 'Next →', 'businessguru' ), 'type' => 'list', ) ); if ( $links ) : ?> '; if (!is_home()) { echo '
  • '; echo 'Home'; echo "
  • "; if (is_category() || is_single()) { echo '
  • '; $category = get_the_category(); if($category[0]){ echo ''.$category[0]->cat_name.''; } if (is_single()) { echo "
  • "; the_title(); echo '
  • '; } } elseif (is_page()) { echo '
  • '; echo the_title(); echo '
  • '; } } elseif (is_tag()) { single_tag_title(); } elseif (is_day()) { echo"
  • Archive for "; the_time('F jS, Y'); echo'
  • '; } elseif (is_month()) { echo"
  • Archive for "; the_time('F, Y'); echo'
  • '; } elseif (is_year()) { echo"
  • Archive for "; the_time('Y'); echo'
  • '; } elseif (is_author()) { echo"
  • Author Archive"; echo'
  • '; } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { echo "
  • Blog Archives"; echo'
  • '; } elseif (is_search()) { echo"
  • Search Results"; echo'
  • '; } echo ''; } function bguru_theme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="li-comment-">
    %s says:'), get_comment_author_link()) ?>
    comment_approved == '0') : ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>
    '.$output.'

    '; echo $output; } class bguru_recent_post extends WP_Widget { function __construct() { $widget_ops = array('classname' => 'widget_recent_entries', 'description' => "Your site’s most recent Posts."); $control_ops = array( 'width' => 200, 'height' =>250 ); parent::WP_Widget( false, $name = __( 'BG Recent Posts', 'business' ), $widget_ops, $control_ops); $this->alt_option_name = 'widget_recent_entries'; add_action( 'save_post', array($this, 'flush_widget_cache') ); add_action( 'deleted_post', array($this, 'flush_widget_cache') ); add_action( 'switch_theme', array($this, 'flush_widget_cache') ); } function widget($args, $instance) { $cache = array(); if ( ! $this->is_preview() ) { $cache = wp_cache_get( 'widget_recent_posts', 'widget' ); } if ( ! is_array( $cache ) ) { $cache = array(); } if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } if ( isset( $cache[ $args['widget_id'] ] ) ) { echo $cache[ $args['widget_id'] ]; return; } ob_start(); extract($args); $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : 'Recent Posts'; /** This filter is documented in wp-includes/default-widgets.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5; if ( ! $number ) $number = 5; $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; /** * Filter the arguments for the Recent Posts widget. * * @since 3.4.0 * * @see WP_Query::get_posts() * * @param array $args An array of arguments used to retrieve the recent posts. */ $r = new WP_Query( apply_filters( 'widget_posts_args', array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ) ) ); global $post; if ($r->have_posts()) : ?> have_posts() ) : $r->the_post(); ?>
    ID) );?>
    Read More
    is_preview() ) { $cache[ $args['widget_id'] ] = ob_get_flush(); wp_cache_set( 'widget_recent_posts', $cache, 'widget' ); } else { ob_end_flush(); } } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['number'] = (int) $new_instance['number']; $instance['show_date'] = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false; $this->flush_widget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); if ( isset($alloptions['widget_recent_entries']) ) delete_option('widget_recent_entries'); return $instance; } function flush_widget_cache() { wp_cache_delete('widget_recent_posts', 'widget'); } function form( $instance ) { $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; $show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false; ?>

    id="get_field_id( 'show_date' ); ?>" name="get_field_name( 'show_date' ); ?>" />