As a member of WordPress users, I really worked hard to pretend (although the js file was not written by me). A firework and vibration special effect in the WordpPress input box, because it is a js file called, so it can be used not only in WordPress , but also in other websites. The js special effects include fireworks and vibration special effects, and you can enable or disable a certain effect respectively.
How to install WordPress input fireworks and vibration effects:
The first step is to download the JS file: activate-power-mode.js (you can click it to download), and upload it to the JS folder of the theme.
The second step is to install the code: add the following code to the end of the theme footer.php file or where you think it is appropriate.
1 |
<script src="<?php bloginfo('template_directory'); ?>/includes/js/activate-power-mode.js "></script> <script> POWERMODE.colorful = true; // true is to |
Note: This WordPress input effect is only used when commenting, so in order not to load these JS files randomly, it is recommended to add a judgment to these codes to determine whether they are article pages or pages, and then load these codes.
If there is no such judgment condition in the footer.php file of the theme used, it is recommended to use the following code:
1 |
<?php if (is_single() || is_page() ) { ?> |
If there is already a judgment condition code <?php if (is_single() || is_page() ) { ?>, you only need to add the code of the second step in it.
Note: If the path uploaded in the first step is not in the JS folder, remember to modify the path when referencing the activate-power-mode.js file in the second step.
Or download another JS: https://github.com/cnguu/Bomb-Typecho-Plugin