ADMEI CMS 功能说明与主题开发指南
支持中英文双语文章发布、分类管理
产品展示、价格、库存管理
首页Banner幻灯片管理
客户留言收集与通知
Blog、Shop、Form等模块开关
RESTful API 支持小程序/APP
公司联系方式、工作时间等
上传/切换 WordPress 格式主题
多角色权限管理
ADMEI CMS 完全兼容 WordPress 主题格式,您可以上传任何 WordPress 主题:
| 文件 | 说明 | 示例 |
|---|---|---|
style.css | 主题信息头部 | Theme Name: My Theme |
index.php | 主模板文件 | 网站主页面 |
| 文件 | 说明 |
|---|---|
functions.php | 主题函数文件 |
screenshot.png | 主题截图 (1200x900) |
header.php | 头部模板 |
footer.php | 底部模板 |
sidebar.php | 侧边栏模板 |
在 themes 目录下创建主题文件夹:
/themes/my-theme/ ├── style.css ├── index.php ├── functions.php └── screenshot.png
/* Theme Name: My Custom Theme Theme URI: https://example.com Author: Your Name Author URI: https://example.com Description: A custom theme for ADMEI CMS Version: 1.0.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: responsive, bilingual, custom Text Domain: my-theme */
<?php
// 引入配置
require_once dirname(__FILE__) . '/../../../config.php';
$pdo = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME, DB_USER, DB_PASS);
$pdo->exec("SET NAMES utf8mb4");
// 获取数据
$slides = $pdo->query("SELECT * FROM admei_slides WHERE status=1")->fetchAll();
$products = $pdo->query("SELECT * FROM admei_products WHERE status='published'")->fetchAll();
?>
<!DOCTYPE html>
<html>
<head>
<title><?php bloginfo('name'); ?></title>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.css">
</head>
<body>
<header>
<h1><?php bloginfo('name'); ?></h1>
</header>
<main>
<?php foreach($slides as $slide): ?>
<div class="slide">
<img src="<?php echo $slide['image']; ?>">
</div>
<?php endforeach; ?>
</main>
</body>
</html>
| 函数 | 说明 |
|---|---|
bloginfo('name') | 网站名称 |
bloginfo('description') | 网站描述 |
bloginfo('template_url') | 主题目录URL |
bloginfo('url') | 网站URL |
| 表名 | 说明 |
|---|---|
admei_articles | 文章 |
admei_products | 产品 |
admei_categories | 栏目 |
admei_slides | 幻灯片 |
admei_company | 公司信息 |
admei_messages | 留言 |
登录后台 → API 管理 → 创建 API Key
| Endpoint | 说明 |
|---|---|
/api.php?request=articles | 文章列表 |
/api.php?request=products | 产品列表 |
/api.php?request=categories | 栏目列表 |
/api.php?request=slides | 幻灯片列表 |
/api.php?request=company | 公司信息 |
/api.php?request=settings | 网站设置 |
curl -H "Authorization: Bearer YOUR_API_KEY" \ https://admei.ganji.au/api.php?request=company
{
"success": true,
"data": {
"name": "ADMEI 公司",
"name_en": "ADMEI Company",
"phone": "0434 488 888",
"email": "info@admei.net",
"address": "墨尔本澳大利亚",
"address_en": "Melbourne, Australia"
}
}