wordpress 首頁模板變量對應表

最近開始學習wp,這裏作一些筆記。javascript

首頁模板,第一行爲前臺顯示的html代碼。第二行爲 wp-content/themes/模板目錄 下 head.php文件中。php

其中我將變量名 html用綠色標記 php代碼用紅色標記css

語言格式html

<html lang="zh-CN">html5

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

頁面編碼app

<meta charset="UTF-8" />學習

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

頁面標題url

<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' ) ); ?>

相關文章
相關標籤/搜索