'ffffff')); add_image_size('aflatoon-featured-image', 1200, 640, true); add_editor_style(); $GLOBALS['content_width'] = 525; register_nav_menus(array( 'top' => __('Top Menu', 'aflatoon'), )); add_theme_support('html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', )); add_theme_support('post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'audio', )); add_theme_support('custom-logo', array( 'width' => 100, 'height' => 100, 'flex-width' => true, )); add_theme_support('customize-selective-refresh-widgets'); } add_action('after_setup_theme', 'aflatoon_setup'); /* == Set the content width in pixels, based on the theme's design and stylesheet == */ function aflatoon_content_width() { $content_width = $GLOBALS['content_width']; $GLOBALS['content_width'] = apply_filters('aflatoon_content_width', $content_width); } add_action('template_redirect', 'aflatoon_content_width', 0); /* == Register widgets == */ function aflatoon_widgets_init() { register_sidebar(array( 'name' => __('Blog Sidebar', 'aflatoon'), 'id' => 'sidebar-1', 'description' => __('Add widgets here to appear in your sidebar on blog posts and archive pages.', 'aflatoon'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action('widgets_init', 'aflatoon_widgets_init'); function aflatoon_sidebar_class() { if(is_active_sidebar('sidebar-1')) echo ' class="with-sidebar"'; } /* == More link label == */ function aflatoon_more_label() { $more_link_label = get_theme_mod('more_link_label'); //$more_link_label = ''; if(empty($more_link_label)) $more_link_label = __('Read more','aflatoon'); return $more_link_label; } /* == more link == */ function aflatoon_excerpt_more($link) { $more_link_label = aflatoon_more_label(); if (is_admin()) { return $link; } $link = sprintf('', esc_url(get_permalink(get_the_ID())), /* translators: %s: Name of current post */ $more_link_label ); return ' … ' . $link; } add_filter('excerpt_more', 'aflatoon_excerpt_more'); /* == Javascript detection == */ function aflatoon_javascript_detection() { echo "\n"; } add_action('wp_head', 'aflatoon_javascript_detection', 0); /* == Pingback url auto-discovery header for singularly identifiable articles == */ function aflatoon_pingback_header() { if (is_singular() && pings_open()) { printf('' . "\n", get_bloginfo('pingback_url')); } } add_action('wp_head', 'aflatoon_pingback_header'); /* == Load css/js scripts == */ function aflatoon_scripts() { // Google font stylesheet wp_register_style('aflatoon-fonts', 'https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i|Raleway:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i|Anton', array(), null); //Normalize stylesheet wp_register_style('aflatoon-custom-reset', get_theme_file_uri('/css/custom-reset.css')); // Theme stylesheet. wp_enqueue_style('aflatoon-style', get_stylesheet_uri(), array('aflatoon-custom-reset', 'aflatoon-fonts')); // Load the html5 shiv. wp_enqueue_script('html5', get_theme_file_uri('/js/html5.js'), array(), '3.7.3'); wp_script_add_data('html5', 'conditional', 'lt IE 9'); wp_register_script('jquery-rotate', get_theme_file_uri('/js/jQueryRotate.js'), array(), '2.3'); //wp_register_script('infinite-scroll', get_theme_file_uri('/js/infinite-scroll.pkgd.min.js'), array(), '3.0.5'); wp_enqueue_script('aflatoon-global', get_theme_file_uri('/js/global.js'), array('jquery', 'jquery-rotate'), '1.0', true); if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } add_action('wp_enqueue_scripts', 'aflatoon_scripts'); /** * Customizer CSS */ function aflatoon_custom_css() { $color_scheme = get_theme_mod('color_scheme'); $logo_border = get_theme_mod('logo_border'); $site_layout = get_theme_mod('site_layout'); ?> '; the_custom_logo(); echo ''; endif; } /* == Display Site title and description == */ function aflatoon_site_info() { echo '
'; echo '

'.get_bloginfo('name').'

'; if(get_bloginfo('description') != "") echo '

'.get_bloginfo('description').'

'; echo '
'; } /* == Display Site navigation == */ function aflatoon_navigation($menu_id, $menu_class, $container_class) { ?> '.__('by','aflatoon').' %s', '' . get_the_author() . '' ); // Finally, let's write all of this to the page. echo '' . aflatoon_time_link() . ' ' . $byline . ''; } endif; if (! function_exists('aflatoon_time_link')) : /** * Gets a nicely formatted string for the published date. */ function aflatoon_time_link() { $time_string = ''; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string = ''; } $time_string = sprintf($time_string, get_the_date(DATE_W3C), get_the_date(), get_the_modified_date(DATE_W3C), get_the_modified_date() ); // Wrap the time string in a link, and preface it with 'Posted on'. return sprintf( /* translators: %s: post date */ __('Posted on %s', 'aflatoon'), '' . $time_string . '' ); } endif; /* == Display Comment link == */ function aflatoon_comment_link() { if(comments_open() && post_type_supports(get_post_type(), 'comments')): echo ''; comments_popup_link(''.__('Leave a Comment','aflatoon'), ''.'1'.' '.__('Comment','aflatoon'), ''.'%'.' '.__('Comments','aflatoon'), 'comments-link', ''); echo ''; endif; } /* == Page pagination == */ function aflatoon_post_pagination() { // Previous/next page navigation. the_posts_pagination(array( 'prev_text' => __('Previous page', 'aflatoon'), 'next_text' => __('Next page', 'aflatoon'), 'before_page_number' => '' . __('Page', 'aflatoon') . ' ', )); } /* == Display next page link for infinite scrolling == */ function aflatoon_infinite_pagination() { if(get_next_posts_link()) { echo '
'; next_posts_link(__('Load more','aflatoon')); echo '
'; } } /* == Single post navigation == */ function aflatoon_post_navigation() { // Previous/next post navigation. the_post_navigation(array( 'next_text' => '