├── README.md ├── functions.php ├── index.php ├── screenshot.png ├── style.css ├── template-parts ├── content-none.php ├── content-page.php ├── content-search.php └── content.php └── theme-screenshot.png /README.md: -------------------------------------------------------------------------------- 1 | # blank-wordpress-theme-for-api 2 | A Blank WordPress theme for headless CMS projects 3 | 4 | ## Endpoints 5 | Provides links for different endpoints for the WordPress API 6 | 7 |  8 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | tag in the document head, and expect WordPress to 27 | * provide it for us. 28 | */ 29 | add_theme_support( 'title-tag' ); 30 | 31 | /* 32 | * Enable support for Post Thumbnails on posts and pages. 33 | * 34 | * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ 35 | */ 36 | add_theme_support( 'post-thumbnails' ); 37 | 38 | // This theme uses wp_nav_menu() in one location. 39 | register_nav_menus( array( 40 | 'menu-1' => esc_html__( 'Primary', 'react' ), 41 | ) ); 42 | 43 | /* 44 | * Switch default core markup for search form, comment form, and comments 45 | * to output valid HTML5. 46 | */ 47 | add_theme_support( 'html5', array( 48 | 'gallery', 49 | 'caption', 50 | ) ); 51 | 52 | // Set up the WordPress core custom background feature. 53 | add_theme_support( 'custom-background', apply_filters( 'react_custom_background_args', array( 54 | 'default-color' => 'ffffff', 55 | 'default-image' => '', 56 | ) ) ); 57 | 58 | // Add theme support for selective refresh for widgets. 59 | add_theme_support( 'customize-selective-refresh-widgets' ); 60 | 61 | /** 62 | * Add support for core custom logo. 63 | * 64 | * @link https://codex.wordpress.org/Theme_Logo 65 | */ 66 | add_theme_support( 'custom-logo', array( 67 | 'height' => 250, 68 | 'width' => 250, 69 | 'flex-width' => true, 70 | 'flex-height' => true, 71 | ) ); 72 | } 73 | endif; 74 | add_action( 'after_setup_theme', 'react_setup' ); 75 | 76 | /** 77 | * Set the content width in pixels, based on the theme's design and stylesheet. 78 | * 79 | * Priority 0 to make it available to lower priority callbacks. 80 | * 81 | * @global int $content_width 82 | */ 83 | function react_content_width() { 84 | $GLOBALS['content_width'] = apply_filters( 'react_content_width', 640 ); 85 | } 86 | add_action( 'after_setup_theme', 'react_content_width', 0 ); 87 | 88 | /** 89 | * Register widget area. 90 | * 91 | * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar 92 | */ 93 | function react_widgets_init() { 94 | register_sidebar( array( 95 | 'name' => esc_html__( 'Sidebar', 'react' ), 96 | 'id' => 'sidebar-1', 97 | 'description' => esc_html__( 'Add widgets here.', 'react' ), 98 | 'before_widget' => '
', 100 | 'before_title' => '