240, 'width' => 240, 'flex-height' => true, ) ); add_image_size('awesomeone-homepage-thumb',240,145,true); register_nav_menus( array( 'primary' => __( 'Primary Menu', 'awesomeone' ), 'footer' => __('Footer Menu', 'awesomeone'), ) ); add_theme_support( 'custom-background', array( 'default-color' => 'ffffff' ) ); // Add support for Block Styles. add_theme_support( 'wp-block-styles' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); add_filter('use_widgets_block_editor', '__return_false'); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script', 'navigation-widgets', ) ); // Add support for responsive embedded content. add_theme_support( 'responsive-embeds' ); add_editor_style( 'editor-style.css' ); } endif; // awesomeone_setup add_action( 'after_setup_theme', 'awesomeone_setup' ); function awesomeone_widgets_init() { register_sidebar( array( 'name' => __( 'Blog Sidebar', 'awesomeone' ), 'description' => __( 'Appears on blog page sidebar', 'awesomeone' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Page Sidebar', 'awesomeone' ), 'description' => __( 'Appears on page sidebar', 'awesomeone' ), 'id' => 'sidebar-2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Header Widget', 'awesomeone' ), 'description' => __( 'Appears on header of the page', 'awesomeone' ), 'id' => 'sidebar-3', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'awesomeone_widgets_init' ); function awesomeone_enqueue_assets() { // Include the file. require_once get_theme_file_path( 'inc/wptt-webfont-loader.php' ); // Load the theme stylesheet. wp_enqueue_style( 'awesomeone', get_stylesheet_directory_uri() . '/style.css', array(), '1.0' ); // Load the webfont. wp_enqueue_style( 'fonts', wptt_get_webfont_url( 'https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&family=PT+Sans:wght@400;700&family=Roboto+Condensed:wght@400;700&display=swap' ), array(), '1.0' ); } add_action( 'wp_enqueue_scripts', 'awesomeone_enqueue_assets' ); function awesomeone_scripts() { wp_enqueue_style( 'awesomeone-basic-style', get_stylesheet_uri() ); wp_enqueue_style( 'awesomeone-editor-style', get_template_directory_uri().'/editor-style.css' ); wp_enqueue_style( 'awesomeone-responsive-style', get_template_directory_uri().'/css/theme-responsive.css' ); wp_enqueue_style( 'awesomeone-nivo-style', get_template_directory_uri().'/css/nivo-slider.css' ); if ( is_home() || is_front_page() ) { wp_enqueue_script( 'awesomeone-nivo-slider', get_template_directory_uri() . '/js/jquery.nivo.slider.js', array('jquery') ); } wp_enqueue_script( 'awesomeone-customscripts', get_template_directory_uri() . '/js/custom.js', array('jquery') ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'awesomeone_scripts' ); function awesomeone_ie_stylesheet(){ global $wp_styles; /** Load our IE-only stylesheet for all versions of IE. * * * Note: It is also possible to just check and see if the $is_IE global in WordPress is set to true before * calling the wp_enqueue_style() function. If you are trying to load a stylesheet for all browsers * EXCEPT for IE, then you would HAVE to check the $is_IE global since WordPress doesn't have a way to * properly handle non-IE conditional comments. */ wp_enqueue_style('awesomeone-ie', get_template_directory_uri().'/css/ie.css', array('awesomeone-ie-style')); $wp_styles->add_data('awesomeone-ie','conditional','IE'); } add_action('wp_enqueue_scripts','awesomeone_ie_stylesheet'); function awesomeone_pagination() { global $wp_query; $big = 12345678; $page_format = paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages, 'type' => 'array' ) ); if( is_array($page_format) ) { $paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged'); echo ''; } } define('pro_theme_url','http://flythemes.net/wordpress-themes/awesomeone-corporate-wordpress-theme/'); define('theme_doc','http://flythemesdemo.net/documentation/awesomeone-doc/'); /** * Implement the Custom Header feature. */ require get_template_directory() . '/inc/custom-header.php'; /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/inc/extras.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Load Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php'; // Block Patterns. require get_template_directory() . '/inc/block-patterns.php'; // Block Styles. require get_template_directory() . '/inc/block-styles.php'; /* * Load customize pro */ require_once( trailingslashit( get_template_directory() ) . 'customize-pro/class-customize.php' ); function awesomeone_custom_blogpost_pagination( $wp_query ){ $big = 999999999; // need an unlikely integer if ( get_query_var('paged') ) { $pageVar = 'paged'; } elseif ( get_query_var('page') ) { $pageVar = 'page'; } else { $pageVar = 'paged'; } $pagin = paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?'.$pageVar.'=%#%', 'current' => max( 1, get_query_var($pageVar) ), 'total' => $wp_query->max_num_pages, 'prev_text' => '« Prev', 'next_text' => 'Next »', 'type' => 'array' ) ); if( is_array($pagin) ) { $paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged'); echo ''; } } // get slug by id function awesomeone_get_slug_by_id($id) { $post_data = get_post($id, ARRAY_A); $slug = $post_data['post_name']; return $slug; } function awesomeone_credit_link(){ return "Powered by WordPress. AwesomeOne theme by Flythemes"; }