This file contains hidden or 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
/* Estilos generales (Ancho del formulario, borde, fondo, tipo de letra...)*/ | |
.wpcf7 {} | |
/* Campo de texto y mensaje*/ | |
.wpcf7-text, .wpcf7-textarea {} | |
/* Estilo al pinchar sobre el campo de texto y mensaje */ | |
.wpcf7-text:focus, .wpcf7-textarea:focus {} | |
/* Etiqueta de los campos*/ |
This file contains hidden or 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
<?php | |
//Si se envía el formulario ... | |
if(isset($_POST['submitted'])) { | |
if(trim($_POST['checking']) !== '') { | |
$captchaError = true; | |
} else { | |
if(trim($_POST['contactName']) === '') { | |
$nameError = 'Por favor añade el nombre'; |
This file contains hidden or 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
<!-- Título para página de búsqueda optimizado --> | |
<!-- Muestra el número de resultados y el término de búsqueda --> | |
<!-- Estiliza el término de búsqueda con la clase .search-term --> | |
<h1 class="page-title">Resultados para la búsqueda <?php /* Número de resultados */ $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; _e(''); _e('<span class="search-term">'); echo $key; _e('</span>'); _e(' — '); echo $count . ' '; _e('Coincidencias'); wp_reset_query(); ?></h1> | |
<style> | |
.search-term { | |
background: #000; /*color de fondo*/ | |
color: #fff; /*color del texto*/ | |
padding: 2px; | |
} |
This file contains hidden or 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
// Shortcode para añadir el año automáticamente en tus publicaciones | |
// [year] | |
function wptutorial_year_shortcode() { // Nombre del shortcode | |
$year = date('Y'); // Código o funcionalidad | |
return $year; | |
} | |
add_shortcode('year', 'wptutorial_year_shortcode'); // Registramos el shortcode para poder usarlo |