esc_html__( 'Main Menu', 'blogpress-2016' ), ) ); add_theme_support( "custom-header" ); add_theme_support( 'custom-background' ); } endif; add_action( 'after_setup_theme', 'blogpress2016_setup' ); /***********************************************************************************************/ /* Content width */ /***********************************************************************************************/ function blogpress2016_content_width() { $GLOBALS['content_width'] = apply_filters( 'blogpress2016_content_width', 900 ); } add_action( 'after_setup_theme', 'blogpress2016_content_width', 0 ); /***********************************************************************************************/ /* Function for Google Fonts */ /***********************************************************************************************/ function blogpress2016_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Lora, translate this to 'off'. Do not translate * into your own language. */ $bitter = _x( 'on', 'Bitter font: on or off', 'blogpress-2016' ); if ( 'off' !== $bitter ) { $font_families = array(); if ( 'off' !== $bitter ) { $font_families[] = 'Bitter:400,700'; } $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return esc_url_raw( $fonts_url ); } /***********************************************************************************************/ /* Proper way to enqueue scripts and styles */ /***********************************************************************************************/ function blogpress2016_scripts() { wp_enqueue_style( 'blogpress2016-bootstrap', THEMEDIR.'/include/css/bootstrap.css'); wp_enqueue_style( 'blogpress2016-fonts', blogpress2016_fonts_url(), array(), null ); wp_enqueue_style( 'blogpress2016-font-awesome', THEMEDIR.'/include/css/font-awesome.min.css'); wp_enqueue_style( 'blogpress2016-theme', get_stylesheet_uri() ); wp_enqueue_script( 'blogpress2016-bootstrap', THEMEDIR.'/include/js/bootstrap.min.js'); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'blogpress2016_scripts' ); /***********************************************************************************************/ /* Registers an editor stylesheet for the theme */ /***********************************************************************************************/ function blogpress2016_add_editor_styles() { add_editor_style(); } add_action('admin_init','blogpress2016_add_editor_styles'); /***********************************************************************************************/ /* Register Sidebar */ /***********************************************************************************************/ add_action( 'widgets_init', 'blogpress2016_widgets_init' ); function blogpress2016_widgets_init() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'blogpress-2016' ), 'id' => 'sidebar-1', 'description' => __( 'Widgets in this area will be shown on all posts and pages.', 'blogpress-2016' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } /***********************************************************************************************/ /* Bootstrap NavWalker for Navigation Menu*/ /***********************************************************************************************/ require_once('wp-bootstrap-navwalker-master/wp_bootstrap_navwalker.php'); require_once('inc/customizer.php'); /***********************************************************************************************/ /*Pagination for paged posts, Page 1, Page 2, Page 3, with Next and Previous Links, No plugin*/ /***********************************************************************************************/ function blogpress2016_wp_pagination() { global $wp_query; $big = 999999999; echo paginate_links(array( 'base' => str_replace($big, '%#%', get_pagenum_link($big)), 'format' => '?paged=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $wp_query->max_num_pages )); } add_action('init', 'blogpress2016_wp_pagination'); // Add our HTML5 Pagination /***********************************************************************************************/ // Custom Comments Callback /***********************************************************************************************/ function blogpress2016comments( $comment, $args, $depth ) { if(in_array($comment->comment_type, array('pingback', 'trackback'))) return; ?>
  • id="comment-">

    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> comment_approved == '0') : ?>

  • '; return $html; } add_filter( 'get_search_form', 'slicemypage_search_form_modify' ); /***********************************************************************************************/ /* Register Custom Excerpt with dots */ /***********************************************************************************************/ function wpdocs_custom_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_length', 'wpdocs_custom_excerpt_length', 999 ); function wpdocs_excerpt_more( $more ) { return ' .....'; } add_filter( 'excerpt_more', 'wpdocs_excerpt_more' ); /***********************************************************************************************/ /* Social Link For User Profile */ /***********************************************************************************************/ function SLICEmyPAGE_new_contactmethods( $contactmethods ) { // Add Twitter $contactmethods['twitter'] = 'Twitter'; //add Facebook $contactmethods['facebook'] = 'Facebook'; //add Pinterest $contactmethods['pinterest'] = 'Pinterest'; //add Google Plus $contactmethods['google_plus'] = 'Google Plus'; //add Dribble $contactmethods['dribble'] = 'Dribble'; //add Instagram $contactmethods['instagram'] = 'Instagram'; return $contactmethods; } add_filter('user_contactmethods','SLICEmyPAGE_new_contactmethods',10,1); ?>