5ucms论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 12521|回复: 1

[主题/模板] header.php简单例子

[复制链接]

670

主题

785

帖子

8228

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
8228
发表于 2021-6-9 08:17:05 | 显示全部楼层 |阅读模式
  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(); ?>
复制代码
回复

使用道具 举报

670

主题

785

帖子

8228

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
8228
 楼主| 发表于 2021-6-9 08:17:24 | 显示全部楼层
get_template_directory_uri() 获取当前文件目录
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|5ucms.com

GMT+8, 2024-3-29 03:20 , Processed in 0.375000 second(s), 29 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表