fix: 修复移动端目录和顶栏链接显示问题
- 移动端抽屉栏新增顶栏自定义链接显示(argon_toolbar_links_left/right) - 优化 have_catalog() 函数,增加对 Gutenberg 标题块和 Markdown 标题的检测 - 自定义链接显示在导航菜单和侧边栏菜单之间
This commit is contained in:
@@ -631,11 +631,19 @@ function have_catalog(){
|
||||
return true;
|
||||
}
|
||||
$content = get_post(get_the_ID()) -> post_content;
|
||||
if (preg_match('/<h[1-6](.*?)>/',$content)){
|
||||
// 检查 HTML 标题标签
|
||||
if (preg_match('/<h[1-6](.*?)>/i', $content)){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
// 检查 Gutenberg 标题块
|
||||
if (preg_match('/<!-- wp:heading/', $content)){
|
||||
return true;
|
||||
}
|
||||
// 检查 Markdown 格式标题(如果启用了 Markdown)
|
||||
if (preg_match('/^#{1,6}\s+/m', $content)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//获取文章 Meta
|
||||
function get_article_meta($type){
|
||||
|
||||
Reference in New Issue
Block a user