for posts and comments. add_theme_support( 'automatic-feed-links' ); // Enable support for custom logo. add_theme_support( 'custom-logo', array( 'height' => 480, 'width' => 480, 'flex-height' => true, ) ); //translations load_theme_textdomain( 'arcegator', get_template_directory() . '/languages' ); // Enable support for Post Thumbnails, and declare two sizes. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 460, 290, array( 'center', 'center') ); //add_image_size( 'blog_thumb', 279, 245, true ); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( 'primary' => __( 'Primary menu', 'arcegator' ) ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); // Add support for responsive embeds. add_theme_support( 'responsive-embeds' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); add_theme_support( 'custom-background', apply_filters( 'arcegator_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); } } add_action( 'after_setup_theme', 'arcegator_theme_setup' ); /**********************************************************************/ /** * Include scripts and styles */ function arcegator_theme_setup_scripts() { $version = '20190829'; // Load our main stylesheet. wp_enqueue_style( 'arcegator_theme-fonts', 'https://fonts.googleapis.com/css?family=Poppins:300,400,400i,500,600,700&display=swap', array( ), $version ); wp_enqueue_style( 'arcegator_theme-styles', get_stylesheet_directory_uri() . '/style.css', array( 'arcegator_theme-fonts' ), $version ); wp_enqueue_style( 'arcegator_theme-extra-styles', get_stylesheet_directory_uri() . '/assets/css/extra.css', array( 'arcegator_theme-fonts', 'arcegator_theme-styles' ), $version ); // Block stylesheets //wp_enqueue_style( 'arcegator_theme-block-style', get_template_directory_uri() . '/assets/css/blocks.css', array( 'arcegator_theme-fonts', 'arcegator_theme-styles', 'arcegator_theme-extra-styles' ), $version ); wp_enqueue_script( 'arcegator-plugin', get_stylesheet_directory_uri() . '/assets/js/plugins.js', array( 'jquery' ), $version, true ); wp_enqueue_script( 'arcegator-main', get_stylesheet_directory_uri() . '/assets/js/main.js', array( 'jquery', 'arcegator-plugin' ), $version, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'arcegator_theme_setup_scripts' ); /** * Enqueue editor styles for Gutenberg */ function arcegator_themme_block_editor_styles() { // Block styles. wp_enqueue_style( 'arcegator_theme-block-editor-style', get_stylesheet_directory_uri() . '/assets/css/blocks.css' ); } add_action( 'enqueue_block_editor_assets', 'arcegator_themme_block_editor_styles' ); /**********************************************************************/ /** * Set the content width in pixels, based on the theme's design and stylesheet. */ function arcegator_theme_content_width() { // This variable is intended to be overruled from themes. // Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}. // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound // phpcs:ignore WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedVariableFound $GLOBALS['content_width'] = apply_filters( 'arcegator_theme_content_width', 1170 ); } add_action( 'after_setup_theme', 'arcegator_theme_content_width', 0 ); /**********************************************************************/ /** * Register Sidebars */ function arcegator_theme_widgets_init() { // Primary Widget area register_sidebar( array( 'name' => esc_html__( 'Primary Widget Area', 'arcegator' ), 'id' => 'sidebar-1', 'description' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer Top Area', 'arcegator' ), 'id' => 'sidebar-2', 'description' => '', 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer Bottom Area', 'arcegator' ), 'id' => 'sidebar-3', 'description' => '', 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } add_action( 'widgets_init', 'arcegator_theme_widgets_init' ); /**********************************************************************/ /** * Excerpt */ function arcegator_theme_excerpt_more( $more ) { return '...'; } add_filter('excerpt_more', 'arcegator_theme_excerpt_more'); add_filter( 'excerpt_length', function($length) { return 42; } ); /**********************************************************************/ /** * Remove Jetpack sharing default position */ function arcegator_jetpack_remove_share() { remove_filter( 'the_content', 'sharing_display', 19 ); remove_filter( 'the_excerpt', 'sharing_display', 19 ); if ( class_exists( 'Jetpack_Likes' ) ) { remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 ); } } add_action( 'loop_start', 'arcegator_jetpack_remove_share' ); /**********************************************************************/ class Archi_Mob_Menu_Walker extends Walker_Nav_Menu { // Displays start of an element. E.g '<li> Item Name' // @see Walker::start_el() function start_el(&$output, $item, $depth=0, $args=array(), $id = 0) { $title = $item->title; $permalink = $item->url; $output .= "<li class='" . implode(" ", $item->classes) . "'>"; //Add SPAN if no Permalink if( !$args->walker->has_children ) { $output .= '<a href="' . $permalink . '">' . $title . '</a>'; } else { $output .= '<a href="' . $permalink . '">' . $title . '</a><div class="submenu-item-btn"><span></span><span></span></div>'; } } } /**********************************************************************/ /** * 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';