5ally

my_react_theme/react-src/public/index.php

Feb 6th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.25 KB | None | 0 0
  1. <?php
  2. // This file is put in wp-content/themes/my_react_theme/react-src/public,
  3. // which when built, is put in wp-content/themes/my_react_theme/.
  4.  
  5.   $TEMPLATE_PATH = parse_url(get_template_directory_uri(), PHP_URL_PATH);
  6. ?>
  7. <!DOCTYPE html>
  8. <html lang="en">
  9. <head>
  10.     <meta charset="<?php bloginfo( 'charset' ); ?>">
  11.     <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
  12.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  13.     <meta name="theme-color" content="#000000">
  14.     <link rel="profile" href="http://gmpg.org/xfn/11">
  15.     <!--
  16.         manifest.json provides metadata used when your web app is added to the
  17.         homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
  18.     -->
  19.     <link rel="manifest" href="<?php echo $TEMPLATE_PATH; ?>/manifest.json">
  20.     <!--
  21.         If you're reading this from "view source" in your browser, it might not make sense as
  22.         these tokens have already been evaluated and replaced, even in this remark blurb.
  23.  
  24.         Notice the use of "php echo $TEMPLATE_PATH;" and %PUBLIC_URL% in the tags above.
  25.         Both will be replaced with the URL of the `public` folder during the build (%PUBLIC_URL%) or
  26.         at render time (php echo $TEMPLATE_PATH;)
  27.         Only files inside the `public` folder can be referenced like this.
  28.  
  29.         Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
  30.         work correctly both with client-side routing and a non-root public URL.
  31.         Learn how to configure a non-root public URL by running `npm run wpbuild`.
  32.     -->
  33.     <?php wp_head(); ?>
  34. </head>
  35.     <body>
  36.     <noscript>
  37.         You need to enable JavaScript to run this app.
  38.     </noscript>
  39.     <div id="root"></div>
  40.     <!--
  41.         This PHP file is a template.
  42.         If you open it directly in the browser, you will see an empty page.
  43.  
  44.         You can add webfonts, meta tags, or analytics to this file.
  45.         The build step will place the bundled scripts into the <body> tag.
  46.  
  47.         To begin the development, run `npm run wpstart` or `yarn wpstart`.
  48.         To create a production bundle, use `npm run wpbuild` or `yarn wpbuild`.
  49.     -->
  50.     <?php wp_footer(); ?>
  51.     </body>
  52. </html>
Add Comment
Please, Sign In to add comment