分类图片获取
This commit is contained in:
浪子
2024-07-25 09:49:31 +08:00
parent 53b3cf13a2
commit 98defefd96
2 changed files with 9 additions and 8 deletions
+2 -3
View File
@@ -17,10 +17,9 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php
// 获取分类 ID
$categoryId = $categories->mid;
// 获取主题URL
$themeUrl = $this->options->themeUrl;
$themeUrl = $this->options->midimg;
// 为每个分类生成图片地址
$categoryImage = $themeUrl . '/dist/img/' . $categoryId . '.jpg';
$categoryImage = $themeUrl . $categoryId . '.jpg';
?>
<div class="category--item">
<img class="category--cover" src="<?php echo $categoryImage; ?>" loading="lazy" alt="<?php $categories->name(); ?>">