Last active
August 29, 2015 13:57
-
-
Save ximosa/9832012 to your computer and use it in GitHub Desktop.
Añadir boton sobre editor de wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Creamos la funcion | |
function mi_generador_boton( $page = null, $target = null ) { | |
//Añádimos css | |
echo '<style> | |
#modal { | |
left:50%; | |
margin:-250px 0 0 -40%; | |
opacity: 0; | |
position:absolute; | |
top:-50%; | |
visibility: hidden; | |
width:80%; | |
box-shadow:0 3px 7px rgba(0,0,0,.25); | |
box-sizing:border-box; | |
transition: all 0.4s ease-in-out; | |
-moz-transition: all 0.4s ease-in-out; | |
-webkit-transition: all 0.4s ease-in-out; | |
} | |
/* Make the modal appear when targeted */ | |
#modal:target { | |
opacity: 1; | |
top:50%; | |
visibility: visible; | |
} | |
#modal .header,#modal .footer { | |
border-bottom: 1px solid #e7e7e7; | |
border-radius: 5px 5px 0 0; | |
} | |
#modal .footer { | |
border:none; | |
border-top: 1px solid #e7e7e7; | |
border-radius: 0 0 5px 5px; | |
} | |
#modal h2 { | |
margin:0; | |
} | |
#modal .btn { | |
float:right; | |
} | |
#modal .copy,#modal .header, #modal .footer { | |
padding:15px; | |
} | |
.modal-content { | |
background: #f7f7f7; | |
position: relative; | |
z-index: 20; | |
border-radius:5px; | |
} | |
#modal .copy { | |
background: #fff; | |
} | |
#modal .overlay { | |
background-color: #000; | |
background: rgba(0,0,0,.5); | |
height: 100%; | |
left: 0; | |
position: fixed; | |
top: 0; | |
width: 100%; | |
z-index: 10; | |
} | |
.button{ | |
background-color: #afcde3; | |
border: 1px solid #afcde3; | |
color: #fff; | |
padding: 5px 10px; | |
} | |
.button:hover { | |
background-color: #83a2be; | |
border: 1px solid #83a2be; | |
} | |
</style> | |
//Añadimos contenido como en http://www.webgae.com/ventanas-modales-responsives-con-solo-css-para-tu-diseno-web/ | |
<a class="button" href="#modal"> Activar ventana</a> | |
<div id="modal"> | |
<div class="modal-content"> | |
<div class="header"> | |
<h2>Titulo de la ventana</h2> | |
</div> | |
<div class="copy"> | |
<p>Aqui el contenido que se desea .</p> | |
</div> | |
<div class="cf footer"> | |
<a href="#">Cerrar</a> | |
</div> | |
</div> | |
<div class="overlay"></div> | |
</div>'; | |
} | |
//Añadimos la accion | |
add_action( 'media_buttons', 'mi_generador_boton', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment