NEXT craftinamerica.org. Base setup for headless wordpress https://www.craftinamerica.org
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.php 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!DOCTYPE html>
  2. <html <?php language_attributes(); ?>>
  3. <head>
  4. <!-- Google tag (gtag.js) -->
  5. <script async src="https://www.googletagmanager.com/gtag/js?id=GT-55XG6M7"></script>
  6. <script>
  7. window.dataLayer = window.dataLayer || [];
  8. function gtag(){dataLayer.push(arguments);}
  9. gtag('js', new Date());
  10. gtag('config', 'GT-55XG6M7');
  11. </script>
  12. <title><?php wp_title(); ?></title>
  13. <meta charset="<?php bloginfo( 'charset' ); ?>">
  14. <meta name="viewport" content="width=device-width, initial-scale=1">
  15. <link rel="prefetch" url="resource-url" />
  16. <?php wp_head(); ?>
  17. </head>
  18. <body>
  19. <div id="content" class="site-content" style="display:none">
  20. <?php
  21. if ( have_posts() ) {
  22. if ( is_home() && ! is_front_page() ) {
  23. echo '<h1>' . single_post_title( '', false ) . '</h1>';
  24. }
  25. while ( have_posts() ) {
  26. the_post();
  27. if ( is_singular() ) {
  28. the_title( '<h1>', '</h1>' );
  29. } else {
  30. the_title( '<h2><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' );
  31. }
  32. the_content();
  33. }
  34. }
  35. ?>
  36. </div>
  37. <div id="wp-app"></div>
  38. <?php wp_footer(); ?>
  39. </body>
  40. </html>