扫码关注官方订阅号
我想自定义搜索显示结果,就是说搜索特定关键词时正常显示搜索结果,同时显示一些指定的内容。我想先获取搜索的关键词,应该用什么方法?
认证高级PHP讲师
可以用$this->_keywords获取当前搜索词
$this->_keywords
/usr/themes/default/archive.php文件,
/usr/themes/default/archive.php
'search' => _t('包含关键字 %s 的文章'),
<h3 class="archive-title"><?php $this->archiveTitle(array( 'category' => _t('分类 %s 下的文章'), 'search' => _t('包含关键字 %s 的文章'), 'tag' => _t('标签 %s 下的文章'), 'author' => _t('%s 发布的文章') ), '', ''); ?></h3>
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
可以用
$this->_keywords
获取当前搜索词/usr/themes/default/archive.php
文件,'search' => _t('包含关键字 %s 的文章'),