__( 'Main Menu', 'santra' ), ) ); /* | ------------------------------------------------------------------- | Adding Post Thumbnails and Image Sizes | ------------------------------------------------------------------- | */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 260, 220 ); // 260 pixels wide by 220 pixels high add_image_size( 'santra-mini', 150, 150, true ); // 160 pixels wide by 120 pixels high add_image_size( 'santra-small', 260, 180, true ); // 260 pixels wide by 180 pixels high add_image_size( 'santra-medium', 360, 268, true ); // 360 pixels wide by 268 pixels high add_image_size( 'santra-large', 560, 368, true ); // 560 pixels wide by 368 pixels high add_image_size( 'page-feature', 1230, 440, true ); //(cropped) add_image_size( 'thumb-feature', 325, 180, true ); //(cropped) add_image_size( 'page-static', 1230, 410, true ); //(cropped) } add_action( 'after_setup_theme', 'santra_theme_setup' ); ################################################################################ // Loading All CSS Stylesheets JS Files ################################################################################ function santra_scripts() { global $wp_styles; // CSS Scripts wp_enqueue_style( 'santra-style', get_stylesheet_uri() ); wp_enqueue_style('santra-bootstrap', get_template_directory_uri().'/assets/css/bootstrap.css', false ,'2.3.1', 'all' ); wp_enqueue_style('santra-responsive', get_template_directory_uri().'/assets/css/bootstrap-responsive.css', false ,'2.3.1', 'all' ); wp_enqueue_style('santra-custom', get_template_directory_uri().'/assets/css/custom.css', false ,'1.0.0', 'all' ); if ( is_home() ) { wp_enqueue_style('santra-carousel', get_template_directory_uri().'/assets/css/carousel.css', false ,'1.0.0', 'all' ); } // Load style.css from child theme if (is_child_theme()) { wp_enqueue_style('strapslider_child', get_stylesheet_uri(), false, null); } // Comments Scripts if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // JS Scripts wp_enqueue_script('bootstrap.min.js', get_template_directory_uri().'/assets/js/bootstrap.min.js', array('jquery'),'2.3.1', true ); if ( is_home() ) { wp_enqueue_script( 'bootstrap-carousel', get_template_directory_uri() . '/assets/js/bootstrap-carousel2.3.1.js', array( 'jquery' ), '2.3.1', true ); } wp_enqueue_script('santra-extras', get_template_directory_uri().'/assets/js/santra-scripts.js', array('jquery'),'1.0', true ); } add_action('wp_enqueue_scripts', 'santra_scripts'); /** * Creates a nicely formatted and more specific title element text * for output in head of document, based on current view. * * @since WPStrapHero 1.0.0 * * @param string $title Default title text for current view. * @param string $sep Optional separator. * @return string Filtered title. */ function santra_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'santra' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'santra_wp_title', 10, 2 ); // Lets load our custom functions and scripts now require( get_template_directory() . '/assets/inc/smart-widgets.php' ); /** * Custom Nav Menu handler for the Navbar. */ require_once( get_template_directory() . '/assets/inc/nav-menu-walker.php' ); if ( ! function_exists( 'santra_comment' ) ) : /** * Template for comments and pingbacks. * * To override this walker in a child theme without modifying the comments template * simply create your own santra_comment(), and that function will be used instead. * * Used as a callback by wp_list_comments() for displaying the comments. */ function santra_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : // Display trackbacks differently than normal comments. ?>
  • id="comment-">

    ', '' ); ?>

  • id="li-comment-">
    %1$s %2$s', get_comment_author_link(), // If current post author is also comment author, make it known visually. ( $comment->user_id === $post->post_author ) ? ' ' . __( 'Post author', 'santra' ) . '' : '' ); printf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s', 'santra' ), get_comment_date(), get_comment_time() ) ); ?>
    comment_approved ) : ?>

    ', '

    ' ); ?>
    __( 'Reply', 'santra' ), 'after' => ' ', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ' . __( 'Sticky', 'santra' ) . ''; if ( ! has_post_format( 'aside' ) && ! has_post_format( 'link' ) && 'post' == get_post_type() ) santra_entry_date(); // Translators: used between list items, there is a space after the comma. $categories_list = get_the_category_list( __( ', ', 'santra' ) ); if ( $categories_list ) { echo '' . $categories_list . ''; } // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list( '', __( ', ', 'santra' ) ); if ( $tag_list ) { echo '' . $tag_list . ''; } // Post author if ( 'post' == get_post_type() ) { printf( '', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'santra' ), get_the_author() ) ), get_the_author() ); } } endif; if ( ! function_exists( 'santra_entry_date' ) ) : /** * Prints HTML with date information for current post. * * Create your own santra_entry_date() to override in a child theme. * * @since WP StrapSlider Lite 1.0.0 * * @param boolean $echo Whether to echo the date. Default true. * @return string */ function santra_entry_date( $echo = true ) { $format_prefix = ( has_post_format( 'chat' ) || has_post_format( 'status' ) ) ? _x( '%1$s on %2$s', '1: post format name. 2: date', 'santra' ): '%2$s'; $date = sprintf( '', esc_url( get_permalink() ), esc_attr( sprintf( __( 'Permalink to %s', 'santra' ), the_title_attribute( 'echo=0' ) ) ), esc_attr( get_the_date( 'c' ) ), esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) ) ); if ( $echo ) echo $date; return $date; } endif; /** * Display navigation to next/previous pages when applicable * */ if ( ! function_exists( 'santra_content_nav' ) ) : function santra_content_nav() { global $wp_query, $wp_rewrite; $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 = ( $wp_rewrite->using_index_permalinks() AND ! strpos( $pagenum_link, 'index.php' ) ) ? 'index.php/' : ''; $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%'; $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $wp_query->max_num_pages, 'current' => $paged, 'mid_size' => 3, 'type' => 'list', 'add_args' => array_map( 'urlencode', $query_args ) ) ); if ( $links ) { echo ""; } } endif; /** * Displays page links for paginated posts */ if ( ! function_exists( 'santra_link_pages' ) ) : function santra_link_pages( $args = array() ) { wp_link_pages( array( 'echo' => 0 )); $defaults = array( 'next_or_number' => 'number', 'nextpagelink' => __('Next page', 'santra'), 'previouspagelink' => __('Previous page', 'santra'), 'pagelink' => '%', 'echo' => true ); $r = wp_parse_args( $args, $defaults ); $r = apply_filters( 'santra_link_pages_args', $r ); extract( $r, EXTR_SKIP ); global $page, $numpages, $multipage, $more, $pagenow, $next_or_number, $previouspagelink, $nextpagelink; $next_or_number = 'number'; $output = ''; if ( $multipage ) { if ( $next_or_number ) { $output .= ''; } else { if ( $more ) { $output .= ''; } } } if ( $echo ) echo $output; return $output; } endif; /** * Sets the post excerpt length to 80 words. */ function santra_excerpt_length($length) { if ( get_theme_mod('santra_excerpt_length') ) : return ( get_theme_mod('santra_excerpt_length') ); else : return 80; endif; } add_filter('excerpt_length', 'santra_excerpt_length'); /** * Returns a "Read more" link for excerpts */ function santra_read_more() { return '
    ' . __('Continue Reading ››', 'santra') . '
    '; } /** * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and santra_read_more_link(). */ function santra_auto_excerpt_more($more) { return '' . santra_read_more(); } add_filter('excerpt_more', 'santra_auto_excerpt_more'); /** * Adds a pretty "Read more" link to custom post excerpts. */ function santra_custom_excerpt_more($output) { if (has_excerpt() && !is_attachment()) { $output .= santra_read_more(); } return $output; } add_filter('get_the_excerpt', 'santra_custom_excerpt_more'); // ADD THEME CUSTOMIZER UNDER APPEARANCE require( get_template_directory() . '/assets/inc/strapcode-customizer.php' ); /* Clearing floats */ function santra_clearboth() { ?>