Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Un plugin:
- <?php
- /*
- Plugin Name: Tous à spoil
- Plugin URI: #
- Description: T'as des spoils qui dépassent du string
- Author: Ozh
- Version: 1.3.3.7
- Author URI: http://ozh.org/
- */
- /*** [spoiler] ***/
- // [spoiler]ce texte est un spoiler[/spoiler]
- function sarl_shortcode_spoiler($attr, $content) {
- $content = antispambot( $content );
- return "<span class=\"spoiler\">$content</span>";
- }
- add_shortcode('spoiler', 'sarl_shortcode_spoiler');
- ?>
- Dans le footer.php, rajouter:
- <script type="text/javascript">
- jQuery(document).ready(function() {
- jQuery("span.spoiler").hide();
- jQuery('<a class="reveal">Spoiler</a>').insertBefore('.spoiler');
- jQuery("a.reveal").click(function(){
- jQuery(this).parents("p").children("span.spoiler").show();
- jQuery(this).parents("p").children("a.reveal").hide();
- });
- });
- </script>
- Dans le style.css du theme, rajouter:
- .reveal {
- font-size: 80%;
- background: #990000;
- color: white;
- font-style: normal;
- cursor: pointer;
- font-weight: bold;
- border: 1px solid #BB0000;
- border-radius: 3px;
- padding: 1px 3px;
- }
- .reveal:hover {
- text-decoration: none;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement