echo '

7. Tamaños de imagen

Galerías: 2.000 px en el lado mayor, sin recortar. Tarjetas de categoría: unos 1.600 × 1.000 px. Portada: 2.000–2.560 px de ancho. Perfil sRGB, formato WebP o JPEG optimizado. Los PPP no influyen en el tamaño mostrado.

'; echo ''; } // Opciones editables desde el personalizador de WordPress. add_action('customize_register', function ($wp_customize) { $wp_customize->add_section('sb_contact_section', ['title'=>'Datos y contacto','priority'=>35]); foreach ([ 'sb_public_email'=>['Correo electrónico público','email'], 'sb_whatsapp'=>['WhatsApp (número con prefijo, sin +)','text'], 'sb_instagram'=>['Instagram (URL completa)','url'], 'sb_area'=>['Zona de servicio','text'], 'sb_intro'=>['Texto breve de portada','textarea'], ] as $id=>$config) { $default = $id==='sb_area' ? 'Marbella · San Pedro Alcántara · Costa del Sol' : ($id==='sb_intro' ? 'Fotografía de eventos, conciertos, deportes y comuniones. Imágenes naturales, momentos auténticos.' : ''); $sanitize = $config[1]==='email' ? 'sanitize_email' : ($config[1]==='url' ? 'esc_url_raw' : 'sanitize_text_field'); $wp_customize->add_setting($id, ['default'=>$default,'sanitize_callback'=>$sanitize]); $wp_customize->add_control($id,['label'=>$config[0],'section'=>'sb_contact_section','type'=>$config[1]]); } }); function sb_gallery_ids($post_id) { return array_values(array_filter(array_map('absint',explode(',',(string)get_post_meta($post_id,'_sb_images',true))),fn($id)=>wp_attachment_is_image($id))); } function sb_gallery_posts() { return get_posts(['post_type'=>'sb_gallery','post_status'=>'publish','posts_per_page'=>100,'orderby'=>['menu_order'=>'ASC','date'=>'DESC']]); } function sb_yt_id($url) { if (!is_string($url) || !$url) return ''; $parts = wp_parse_url($url); if (!$parts || empty($parts['host'])) return ''; $host = strtolower($parts['host']); if (in_array($host,['youtu.be','www.youtu.be'],true)) $id = trim($parts['path'] ?? '', '/'); elseif (in_array($host,['youtube.com','www.youtube.com','m.youtube.com','youtube-nocookie.com','www.youtube-nocookie.com'],true)) { parse_str($parts['query'] ?? '',$query); $path = trim($parts['path'] ?? '', '/'); $id = $query['v'] ?? (preg_match('~^(?:shorts|embed|live)/([A-Za-z0-9_-]{11})~', $path, $m) ? $m[1] : ''); } else return ''; return preg_match('/^[A-Za-z0-9_-]{11}$/D', (string)$id) ? $id : ''; } function sb_contact_link() { $number = preg_replace('/\D+/','',(string)get_theme_mod('sb_whatsapp','')); if ($number) return 'https://wa.me/'.$number; $email = sanitize_email(get_theme_mod('sb_public_email','')); return $email ? 'mailto:'.$email : get_permalink(get_page_by_path('contacto')); } // SEO básico sin plugin adicional. Para SEO avanzado puede añadirse uno posteriormente. add_filter('document_title_parts', function ($parts) { if (is_front_page()) $parts['title']='Fotógrafo profesional en Marbella y Costa del Sol'; if (is_singular('sb_gallery')) { $title = get_the_excerpt(); $parts['title'] = $title ?: get_the_title().' | Fotografía en Marbella'; } if (is_post_type_archive('sb_video')) $parts['title']='Vídeo profesional en Marbella y Costa del Sol'; return $parts; }); function sb_meta_description() { if (is_front_page()) return 'Fotógrafo profesional en Marbella, San Pedro Alcántara y Costa del Sol. Fotografía de eventos, conciertos, deportes y comuniones. Descubre el portfolio de Sergio Bull.'; if (is_singular('sb_gallery')) { $text = get_post_field('post_content',get_queried_object_id()); return wp_trim_words(wp_strip_all_tags(strip_shortcodes($text)), 27, ''); } if (is_post_type_archive('sb_video')) return 'Selección de trabajos audiovisuales de Sergio Bull. Vídeos de eventos y espectáculos en Marbella y la Costa del Sol.'; if (is_page('sobre-mi')) return 'Conoce a Sergio Bull, fotógrafo y videógrafo de eventos, conciertos, deportes y comuniones en Marbella y la Costa del Sol.'; if (is_page('contacto')) return 'Contacta con Sergio Bull Fotografía para fotografía de eventos, conciertos, deportes o comuniones en Marbella y la Costa del Sol.'; return ''; } add_action('wp_head', function () { if (is_admin() || !is_singular() && !is_front_page() && !is_post_type_archive('sb_video')) return; $desc = sb_meta_description(); if ($desc) echo '' . "\n"; $title = wp_get_document_title(); $url = is_front_page() ? home_url('/') : (is_post_type_archive('sb_video') ? get_post_type_archive_link('sb_video') : get_permalink()); echo '' . "\n"; echo '' . "\n"; if ($desc) echo '' . "\n"; if ($url) echo '' . "\n"; $imgid = is_singular('sb_gallery') ? get_post_thumbnail_id() : 0; if ($imgid) echo '' . "\n"; echo '' . "\n"; if (is_front_page()) { $schema = ['@context'=>'https://schema.org','@type'=>'ProfessionalService','name'=>'Sergio Bull Fotografía','url'=>home_url('/'), 'description'=>$desc,'areaServed'=>['Marbella','San Pedro Alcántara','Costa del Sol'],'serviceType'=>['Fotografía de eventos','Fotografía de conciertos','Fotografía deportiva','Fotografía de comuniones']]; $email = sanitize_email(get_theme_mod('sb_public_email','')); if ($email) $schema['email']=$email; echo '' . "\n"; } }, 5); // Formulario sencillo sin plugin, con nonce, honeypot y limitación de intentos. function sb_process_contact() { if (empty($_POST['sb_contact_submit'])) return; $back = get_permalink(get_page_by_path('contacto')); if (!isset($_POST['sb_contact_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['sb_contact_nonce'])),'sb_contact')) { wp_safe_redirect(add_query_arg('envio','error',$back)); exit; } // Comprobar también en el servidor la casilla de información de privacidad. if (!isset($_POST['sb_privacy']) || !is_string($_POST['sb_privacy']) || wp_unslash($_POST['sb_privacy']) !== '1') { wp_safe_redirect(add_query_arg('envio','error',$back)); exit; } if (!empty($_POST['sb_website'])) { wp_safe_redirect(add_query_arg('envio','ok',$back)); exit; } $name = sanitize_text_field(wp_unslash($_POST['sb_name'] ?? '')); $email = sanitize_email(wp_unslash($_POST['sb_email'] ?? '')); $message = sanitize_textarea_field(wp_unslash($_POST['sb_message'] ?? '')); $key = 'sb_contact_'.md5($_SERVER['REMOTE_ADDR'] ?? 'unknown'); if (get_transient($key) || !$name || !is_email($email) || strlen($message)<12 || strlen($message)>4000) {wp_safe_redirect(add_query_arg('envio','error',$back));exit;} $to = sanitize_email(get_theme_mod('sb_public_email','')); if (!$to) { wp_safe_redirect(add_query_arg('envio','error',$back));exit; } set_transient($key,1,60); $ok = wp_mail($to,'Consulta web · Sergio Bull Fotografía',"Nombre: {$name}\nCorreo: {$email}\n\n{$message}",['Reply-To: '.$email]); wp_safe_redirect(add_query_arg('envio',$ok?'ok':'error',$back)); exit; } add_action('admin_post_nopriv_sb_contact','sb_process_contact'); add_action('admin_post_sb_contact','sb_process_contact');

ERROR 404

Esta página no está disponible

Quizá la dirección haya cambiado. Puedes volver a la portada y explorar mis galerías.

Volver a inicio ↗