Recent Posts

WP和任意网站如何按钮切换黑暗模式和白昼模式

首先我们先给body标签添加class名字:<body class="light-mode"> 然后去任意你想要添加切换按钮的地方添加切换按钮:<button id="toggle-mode">Toggle Mode</button> 注意class名称和下面的js和css文件要对应。 然后添加css样式: /* Light mode styles */ .light-mode { background-color: whit...

Read More »

WordPress文章如何添加浏览次数

在主题文件夹下面的inc文件夹(如果没有就新建一个),新建一个postviews.php文件,然后在functions.php里面引入: require get_template_directory() . '/inc/postviews.php' 然后在文件里粘贴: <?php // function to display number of posts. // 可以在后台设置一个option来决定是否开启浏览次数 func...

Read More »