zoukankan      html  css  js  c++  java
  • WordPress模板基本文件

    style.css 样式表文件

    index.php 主页文件

    single.php 日志单页文件

    page.php 页面文件

    archvie.php 分类和日期存档页文件

    searchform.php 搜索表单文件

    search.php 搜索页面文件

    comments.php 留言区域文件(包括留言列表和留言框)

    404.php 404错误页面

    header.php 网页头部文件

    sidebar.php 网页侧边栏文件

    footer.php 网页底部文件

    1. style.css

      /*
      Theme Name: utubon.com

      Theme URI:

      Description: wordpress

      Author: wordpress

      Version: 1.0

      License:

      License URI:

      Tags: wordpress

      */


    2. function.php
    3. index.php

    模板文件之间的调用

    wordpress使用模板通过函数的调用,让模板之间形成完整的整体,例如在index.php中你会看到get_header()即调用文件名为header.php的模板文件, get_footer()亦然。get_template_part( 'loop', 'index' );则是调用模板loop-index.php。wordpress并非傻瓜的像include()函数一样包含这些文件,而是对文件的存在与否要进行判断,如果不存在该文件将用对应的相关文件代替,这需要你查看开发文档中该函数的具体解释。

    文件名一般作用对应的函数备注
    style.css 样式表 <?php bloginfo( 'stylesheet_url' ); ?>调用地址  
    index.php wp识别首页 自动识别  
    functions.php 包含增函数和新功能 自动识别  
    header.php 头部 get_header()  
    footer.php 尾部 get_footer  
    sidebar.php 边侧栏 get_sidebar('foot')(无参数则调用sidebar.php) 参数foot指文件sidebar-foot.php类推
    loop.php
    content.php
    内容循环 get_template_part( 'loop', 'index' )和sidebar一样  参数的意思是调用模板loop-index.php类推如果get_template_part( 'content','single' );
    404.php
    search.php
    single.php
    分别是404页,搜索页,单独页面,文章内容页 自动识别,和index.php一样,使用上述函数,没有该文件的话用index.php  
    archive.php
    category.php
    tag.php
    arthor.php
    分别是归档页,分类页,标签页,作者页 同上,但如果只有archive.php或category.php没有其他页,其他页用archive.php代替或category.php代替  
  • 相关阅读:
    echarts 报表使用
    Eclipse Java注释模板设置详解
    简单实现支付密码输入框 By HL
    一个label 混搭不同颜色,不同字体的文字.. by 徐
    有关MVC设计模式 #DF
    自定义粘贴板-陈鹏
    TableView 常用技巧与功能详解
    ios 类别和扩展-赵小波
    推荐一本书--《浪潮之巅》(完整版的哦)----董鑫
    iOS block的用法 by -- 周傅琦君
  • 原文地址:https://www.cnblogs.com/wpxuexi/p/6555922.html
Copyright © 2011-2022 走看看