当前位置: WordPress教程 > 主题开发 > 阅读正文

wordpress后台显示主题信息

2021.4.22.   864 次   971字

对于创建好的空主题, 我们给它增加一些描述信息, 以便能在后台阅读主题相关信息, 主要有2个步骤

  • style.css指定主题描述信息
  • 增加screenshot背景图片

style.css指定主题描述

对于创建好的空主题, 我们应该使用style.css指定主题信息

我们在multipro目录下的style.css中, 写入如下代码

/*
Theme Name: MultiPro
Theme URI: https://wordpress.org/themes/multipro/
Author: zhufenghua
Author URI: https://www.52dixiaowo.com/
Description: MultiPro 是一个非常适合于多站点的主题, 非常便捷的多站点内联, 是52的小窝所使用的主题之一.
Requires at least: 5.4
Tested up to: 5.5.1
Requires PHP: 5.6
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: MultiPro
Tags: flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, threaded-comments, translation-ready, block-patterns

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.

*/

此时, 我们就可以在后台的主题详情中看到如下内容

指定screenshot背景图

接下来, 我们给它增加一个背景图, 这样就能在后台详情中看到, 这里给一个测试图片, 这个图片的命名可以是以下2种之一

  1. screenshot.png
  2. screenshot.jpg

此时, 我就可以在后台看到主题的图像了

本篇完,还有疑问?

加入QQ交流群:11500065636 IT 技术交流群