如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
主题创建
新建模板目录

style.css中设置模板的基本参数
/*
Theme Name: 子枫测试模板
Theme URI: https://wordpress.org/themes/twentyfifteen/
Author: 子枫
Author URI: https://wordpress.org/
Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen's simple, straightforward typography is readable on a wide variety of screen sizes, and suitable for multiple languages. We designed it using a mobile-first approach, meaning your content takes center-stage, regardless of whether your visitors arrive by smartphone, tablet, laptop, or desktop computer.
Version: 0.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, two-columns, left-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
Text Domain: twentyfifteen
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/
/*#header{
background: green;
}*/
新建index.php header.php footer.php
index.PHP文件调用header.php的两种方法
1. <?php get_header(); ?> 2. <?php include 'header.php'; ?>
调用数据库数据
调用wp_options表的数据 : get_option(键名)获取wp_option表的数据,你也可以通过update_option(键名,新的键值)函数修改键值
ps:数据表中键名以_开头的都是隐藏的,也就是不会显示在后台仪表盘页面上给用户看到
例:
<?php echo get_option('blogname'); ?>
> 本文由子枫笔记快捷发布!
王明昌博客
