tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Add styling for tiny-mce editor. */ add_editor_style( 'assets/css/editor-style.css' ); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); /* * Add custom image sizes as required by the theme. * * @link https://developer.wordpress.org/reference/functions/add_image_size/ */ add_image_size( 'amathambo-widgets', 90, 90, array( 'center', 'center' ) ); add_image_size( 'amathambo-masonry', 710 ); /* * The theme uses wp_nav_menu() in three locations. */ register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'amathambo' ), 'social' => esc_html__( 'Social', 'amathambo' ), 'footer' => esc_html__( 'Footer', 'amathambo' ), ) ); /* * 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', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'amathambo_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'height' => 100, 'width' => 100, 'flex-width' => false, 'flex-height' => false, ) ); /** * Add support for full and wide align images. */ add_theme_support( 'align-wide' ); /** * Add support for Block Styles */ add_theme_support( 'wp-block-styles' ); } add_action( 'after_setup_theme', 'amathambo_setup' ); } // End if(). if ( ! function_exists( 'amathambo_content_width' ) ) { /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function amathambo_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. $GLOBALS['content_width'] = apply_filters( 'amathambo_content_width', 960 ); } add_action( 'after_setup_theme', 'amathambo_content_width', 0 ); } /** * Register Custom Widgets. */ function amathambo_custom_widgets() { register_widget( 'Amathambo_Popular_Posts' ); register_widget( 'Amathambo_Recent_Posts' ); register_widget( 'Amathambo_Featured_Posts' ); } add_action( 'widgets_init', 'amathambo_custom_widgets' ); if ( ! function_exists( 'amathambo_widgets_init' ) ) { /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function amathambo_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Footer 1', 'amathambo' ), 'id' => 'footer-1', 'description' => esc_html__( 'First of 3 footer widgets.', 'amathambo' ), 'before_widget' => '', 'before_title' => '