wordpress 首页模板变量对应表

猫哥 程序代码评论字数 2408阅读8分1秒阅读模式

首页模板,第一行为前台显示的html代码。第二行为 wp-content/themes/模板目录 下 head.php文件中。

其中我将变量名 html用绿色标记 php代码用红色标记

语言格式

<html lang="zh-CN">

<html <?php language_attributes(); ?>>

页面编码

<meta charset="UTF-8" />

<meta charset="<?php bloginfo( 'charset' ); ?>" />

页面标题

<title>谢寒博客 | 又一个WordPress站点</title>

<title> <?php wp_title( '|', true, 'right' ); ?> </title>

发布街口

<link rel="pingback" href="http://localhost/blog/xmlrpc.php" />

<link rel="pingback" href=" <?php bloginfo( 'pingback_url' ); ?> " />

目录地址:

<script src="http://localhost/blog/wp-content/themes/twentytwelve/js/html5.js" type="text/javascript"></script>

<script src=" <?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>

css和js地址

<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://localhost/blog/xmlrpc.php?rsd" />

<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://localhost/blog/wp-includes/wlwmanifest.xml" />

<meta name="generator" content="WordPress 3.6" />

<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>

<style type="text/css" media="print">#wpadminbar { display:none; }</style>

<style type="text/css" media="screen">

html { margin-top: 28px !important; }

* html body { margin-top: 28px !important; }

</style>

<?php wp_head(); ?>

body class

<body class="home blog logged-in admin-bar no-customize-support custom-font-enabled single-author" >

<body <?php body_class(); ?> >

 

标题部分

<h1 class="site-title">

<a href="http://localhost/blog/"

title="站点标题" rel="home">

站点标题</a></h1>

<h1 class="site-title">

<a href=" <?php echo esc_url( home_url( '/' ) ); ?> "

title=" <?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?> " rel="home">

<?php bloginfo( 'name' ); ?> </a></h1>

 

副标题

<h2 class="site-description">又一个WordPress站点</h2>

<h2 class="site-description"> <?php bloginfo( 'description' ); ?> </h2>

 

菜单

<h3 class="menu-toggle">菜单</h3>

<h3 class="menu-toggle"> <?php _e( 'Menu', 'twentytwelve' ); ?></h3>

跳至内容

<a class="assistive-text" href="#content" title=" 跳至内容">跳至内容</a>

<a class="assistive-text" href="#content" title=" <?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?> </a>

 

导航栏

<div class="nav-menu"><ul><li class="current_page_item"><a href="http://localhost/blog/" title="首页">首页</a></li><li class="page_item page-item-2"><a href="http://localhost/blog/?page_id=2">示例页面</a></li></ul></div>

 

<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>

 

 

原贴 wordpress 首页模板变量对应表 - 谢寒 - 博客园 https://www.cnblogs.com/officexie/p/3272255.html

继续阅读
猫哥
  • 本文由 发表于 2019-08-02 11:27:04
  • 转载请务必保留本文链接:https://www.588693.com/1468.html
安卓通过shell命令启动APP怎么操作 程序代码

安卓通过shell命令启动APP怎么操作

要启动Android应用程序,可以使用adb shell命令,语法如下:adb shell am start -n /。其中,是应用程序的包名,是应用程序的入口Activity名称。 相关问题 and...
Android build.prop简介 程序代码

Android build.prop简介

build.prop位于手机的/system/build.prop中 build.prop记录一些系统设置,是一个属性文件,相当于Windows系统的注册表。 build.prop生成: Make系统...
php程序列表程序 程序代码

php程序列表程序

记录备份一下 H5ai,就是一个文件目录列表程序,可以搭建在服务器上,可以作为下载站点,也可以当成私有云盘。h5ai是一款功能强大 php 文件目录列表程序,不需要数据库,支持在线预览文本、图片、音频...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定