5ucms论坛

标题: header.php简单例子 [打印本页]

作者: admin    时间: 2021-6-9 08:17
标题: header.php简单例子
  1. <?php
  2. /**
  3. * The header.
  4. *
  5. * This is the template that displays all of the <head> section and everything up until main.
  6. *
  7. * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
  8. *
  9. * @package WordPress
  10. * @subpackage Twenty_Twenty_One
  11. * @since Twenty Twenty-One 1.0
  12. */

  13. ?>
  14. <!doctype html>
  15. <html <?php language_attributes(); ?> >
  16. <head>
  17.         <meta charset="<?php bloginfo( 'charset' ); ?>" />
  18.         <title><? wp_title(); ?></title>
  19.         <meta name="viewport" content="width=device-width, initial-scale=1" />
  20.         <link rel="stylesheet" href="<? echo get_template_directory_uri() ?>"/css/style.js">
  21.         <script src="<? echo get_template_directory_uri();?>/js/jquery.js">
  22.         <?php wp_head(); ?>
  23. </head>

  24. <body <?php body_class(); ?>>
  25. <?php wp_body_open(); ?>
复制代码

作者: admin    时间: 2021-6-9 08:17
get_template_directory_uri() 获取当前文件目录




欢迎光临 5ucms论坛 (http://bbs.5ucms.com/) Powered by Discuz! X3.2