diff --git a/functions.php b/functions.php index 69b6791..21f759f 100644 --- a/functions.php +++ b/functions.php @@ -9,6 +9,7 @@ load_template($optionsfile); add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts'); include('optionjs.php'); +include('shortcode.php'); //邮件通知 by Qiqiboy function comment_mail_notify($comment_id) @@ -228,6 +229,7 @@ function clear_db_cache_archives_list() add_action('save_post', 'clear_db_cache_archives_list'); // 新发表文章/修改文章时 + //文章目录TOC function article_toc($content) { @@ -237,7 +239,6 @@ function article_toc($content) * 博客:https://jakting.com/ * 修改时间:2019年10月15日 */ - $reg_title = '/(.*?)<\/h.*?>/'; $content_toc = ""; if ($title_2 != 0) $content_toc .= ""; $content_toc .= ""; - $content = apply_filters('the_content', $content); - $content = str_replace(']]>', ']]>', $content); + $content = tm_shortcode($content); $flag = true; //修改文章内部链接完成 $return = array($content, $content_toc,$flag); @@ -386,7 +387,6 @@ function TM_GetUserAgent($ua) } return $os . " | " . $br; } - //自定义评论列表模板,来自 https://dedewp.com/17366.html function zmblog_comment($comment, $args, $depth) { diff --git a/page.php b/page.php index 25d9550..7b87945 100644 --- a/page.php +++ b/page.php @@ -25,7 +25,7 @@ class="mdui-text-color-white tm-index-single-title">
-

+

本文采用 CC BY-NC-SA 3.0 协议进行许可,在您遵循此协议的情况下,可以自由共享与演绎本文章。

本文链接:

diff --git a/shortcode.php b/shortcode.php new file mode 100644 index 0000000..d882edc --- /dev/null +++ b/shortcode.php @@ -0,0 +1,63 @@ +', + '
', + '

', + '
', + '
', + '
', + '

', + '

', + ), + $content); + + //按钮 + $content = str_replace( + array('[btn]', '[btn-flat]','[btn-white]','[btn-white-flat]', '[/btn]', '[btn-url]', '[/btn-url]', '[btn-url-new]','[/btn-url-new]'), + array( + '