NEXT craftinamerica.org. Base setup for headless wordpress https://www.craftinamerica.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.php 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE html>
  2. <html <?php language_attributes(); ?>>
  3. <head>
  4. <title><?php wp_title(); ?></title>
  5. <meta charset="<?php bloginfo( 'charset' ); ?>">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="prefetch" url="resource-url" />
  8. <?php wp_head(); ?>
  9. </head>
  10. <body>
  11. <div id="content" class="site-content" style="display:none">
  12. <?php
  13. if ( have_posts() ) {
  14. if ( is_home() && ! is_front_page() ) {
  15. echo '<h1>' . single_post_title( '', false ) . '</h1>';
  16. }
  17. while ( have_posts() ) {
  18. the_post();
  19. if ( is_singular() ) {
  20. the_title( '<h1>', '</h1>' );
  21. } else {
  22. the_title( '<h2><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' );
  23. }
  24. the_content();
  25. }
  26. }
  27. ?>
  28. </div>
  29. <div id="wp-app"></div>
  30. <?php wp_footer(); ?>
  31. </body>
  32. </html>