Implementación masiva de 10 funcionalidades usando agentes paralelos para máxima eficiencia. **Issues Completados:** **Issue #34 - Modal de Contacto con Webhook:** - modal-contact.html: Modal Bootstrap 5 independiente - assets/css/modal-contact.css: Estilos completos con validaciones visuales - assets/js/modal-contact.js: Validaciones (email regex, WhatsApp 10-15 dígitos), envío webhook, GA4 tracking - footer.php: Agregado div#modalContainer - inc/enqueue-scripts.php: Enqueue CSS y JS **Issue #35 - Botón Let's Talk en Navbar:** - header.php: Botón CTA con gradiente naranja (#FF6B35 → #FF8C42) - assets/css/custom-style.css: Animaciones hover (elevación + sombra) - assets/js/main.js: GA4 tracking de clicks **Issue #36 - CTA Box en Sidebar:** - template-parts/cta-box-sidebar.php: Template reutilizable - assets/css/cta-box-sidebar.css: Gradiente naranja-amarillo, sticky junto con TOC - sidebar.php: Integración del CTA box - inc/enqueue-scripts.php: Enqueue condicional (solo single posts) **Issue #37 - Formulario de Contacto en Footer (5ta área de widgets):** - functions.php: Registro de widget footer-contact - footer.php: Sección completa con layout 2 columnas (info + formulario) - assets/css/footer-contact.css: Iconos naranja, validaciones, responsive - assets/js/footer-contact.js: Validaciones, webhook Make.com, GA4 tracking completo - inc/enqueue-scripts.php: Enqueue condicional **Issue #38 - Schema FAQPage Automático:** - inc/schema-org.php: Función apus_get_faqpage_schema() - Detecta H3 con signo de interrogación - Extrae respuestas del siguiente <p> - Genera FAQPage con mínimo 2 preguntas, máximo 10 - JSON-LD integrado en @graph **Issue #39 - Top Notification Bar:** - header.php: Barra con fondo #4C5C6B, texto turquesa #61c7cd - assets/css/notification-bar.css: Animación slideDown, responsive - assets/js/notification-bar.js: Cookie 7 días, cierre con Escape, ajuste navbar - inc/enqueue-scripts.php: Enqueue de assets **Issue #40 - Hero Section con Diseño Específico:** - template-parts/content-hero.php: Hero con degradado azul (#1e3a5f → #2c5282) - assets/css/hero-section.css: Badges arriba de H1, text-shadow, responsive - single.php: Integración del hero section - inc/template-tags.php: Función apus_get_reading_time() - inc/enqueue-scripts.php: Enqueue condicional **Issue #41 - Navbar con Colores RDash:** - assets/css/custom-style.css: Navbar fondo #0E2337, links blancos, hover turquesa #61c7cd - header.php: Clases navbar-dark, eliminado bg-white **Issue #42 - Schema HowTo para Procesos:** - inc/schema-org.php: Función apus_get_howto_schema() - Detecta secciones con id="proceso" - Extrae pasos de listas ordenadas <ol> - Genera HowTo schema con imagen y tiempo estimado - JSON-LD integrado en @graph **Issue #43 - Schema VideoObject:** - inc/schema-org.php: Funciones apus_get_video_schemas() y apus_get_vimeo_data() - Detecta embeds de YouTube y Vimeo - Genera VideoObject schemas con thumbnails - Cache 24h para datos de Vimeo - Soporte múltiples videos por post **Limpieza de Código:** - Eliminados TODOS los archivos .md de reportes (contaminaban el código) - Eliminadas carpetas docs/ con documentación innecesaria - Toda la documentación está en los issues de GitHub **Archivos Nuevos:** - 15 archivos funcionales (HTML, CSS, JS, PHP templates) **Archivos Modificados:** - 9 archivos del tema - 16 archivos .md eliminados (limpieza) **Estadísticas:** - Total funciones nuevas: 70+ - Líneas de código: 5,000+ líneas - Schemas JSON-LD: 3 nuevos (FAQPage, HowTo, VideoObject) - Sistemas de conversión: 4 (modal, botón navbar, CTA sidebar, formulario footer) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
283 lines
8.8 KiB
PHP
283 lines
8.8 KiB
PHP
<?php
|
|
/**
|
|
* Apus Theme Functions and Definitions
|
|
*
|
|
* @package Apus_Theme
|
|
* @since 1.0.0
|
|
*/
|
|
|
|
// Exit if accessed directly
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* Theme Version
|
|
*/
|
|
define('APUS_VERSION', '1.0.0');
|
|
|
|
/**
|
|
* Theme Setup
|
|
*/
|
|
function apus_theme_setup() {
|
|
// Make theme available for translation
|
|
load_theme_textdomain('apus-theme', get_template_directory() . '/languages');
|
|
|
|
// Let WordPress manage the document title
|
|
add_theme_support('title-tag');
|
|
|
|
// Enable support for Post Thumbnails
|
|
add_theme_support('post-thumbnails');
|
|
|
|
// Add image sizes
|
|
add_image_size('apus-thumbnail', 400, 300, true);
|
|
add_image_size('apus-medium', 800, 600, true);
|
|
add_image_size('apus-large', 1200, 900, true);
|
|
add_image_size('apus-featured-large', 1200, 600, true);
|
|
add_image_size('apus-featured-medium', 800, 400, true);
|
|
|
|
// Switch default core markup to output valid HTML5
|
|
add_theme_support('html5', array(
|
|
'gallery',
|
|
'caption',
|
|
'style',
|
|
'script',
|
|
));
|
|
|
|
// Set content width
|
|
if (!isset($content_width)) {
|
|
$content_width = 1200;
|
|
}
|
|
|
|
// Register navigation menus
|
|
register_nav_menus(array(
|
|
'primary' => __('Primary Menu', 'apus-theme'),
|
|
'footer' => __('Footer Menu', 'apus-theme'),
|
|
));
|
|
}
|
|
add_action('after_setup_theme', 'apus_theme_setup');
|
|
|
|
/**
|
|
* Set the content width in pixels
|
|
*/
|
|
function apus_content_width() {
|
|
$GLOBALS['content_width'] = apply_filters('apus_content_width', 1200);
|
|
}
|
|
add_action('after_setup_theme', 'apus_content_width', 0);
|
|
|
|
/**
|
|
* Enqueue Scripts and Styles
|
|
*/
|
|
function apus_enqueue_scripts() {
|
|
// Main stylesheet
|
|
wp_enqueue_style(
|
|
'apus-theme-style',
|
|
get_stylesheet_uri(),
|
|
array(),
|
|
APUS_VERSION
|
|
);
|
|
|
|
// Print styles
|
|
wp_enqueue_style(
|
|
'apus-print-style',
|
|
get_template_directory_uri() . '/assets/css/print.css',
|
|
array('apus-theme-style'),
|
|
APUS_VERSION,
|
|
'print'
|
|
);
|
|
}
|
|
add_action('wp_enqueue_scripts', 'apus_enqueue_scripts');
|
|
|
|
/**
|
|
* Register Widget Areas
|
|
*/
|
|
function apus_register_widget_areas() {
|
|
// Primary Sidebar
|
|
register_sidebar(array(
|
|
'name' => __('Primary Sidebar', 'apus-theme'),
|
|
'id' => 'sidebar-1',
|
|
'description' => __('Main sidebar widget area', 'apus-theme'),
|
|
'before_widget' => '<section id="%1$s" class="widget %2$s">',
|
|
'after_widget' => '</section>',
|
|
'before_title' => '<h2 class="widget-title">',
|
|
'after_title' => '</h2>',
|
|
));
|
|
|
|
// Footer Contact Form (Issue #37) - ARRIBA de los 4 widgets
|
|
register_sidebar(array(
|
|
'name' => __('Footer Contact Form', 'apus-theme'),
|
|
'id' => 'footer-contact',
|
|
'description' => __('Área de contacto arriba de los 4 widgets del footer', 'apus-theme'),
|
|
'before_widget' => '<section id="%1$s" class="footer-contact-widget %2$s">',
|
|
'after_widget' => '</section>',
|
|
'before_title' => '<h3 class="widget-title">',
|
|
'after_title' => '</h3>',
|
|
));
|
|
|
|
// Footer Widget Areas
|
|
for ($i = 1; $i <= 4; $i++) {
|
|
register_sidebar(array(
|
|
'name' => sprintf(__('Footer Column %d', 'apus-theme'), $i),
|
|
'id' => 'footer-' . $i,
|
|
'description' => sprintf(__('Footer widget area %d', 'apus-theme'), $i),
|
|
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
|
'after_widget' => '</div>',
|
|
'before_title' => '<h3 class="widget-title">',
|
|
'after_title' => '</h3>',
|
|
));
|
|
}
|
|
}
|
|
add_action('widgets_init', 'apus_register_widget_areas');
|
|
|
|
/**
|
|
* Configure locale and date format
|
|
*/
|
|
function apus_configure_locale() {
|
|
// Set locale to es_MX
|
|
add_filter('locale', function($locale) {
|
|
return 'es_MX';
|
|
});
|
|
}
|
|
add_action('after_setup_theme', 'apus_configure_locale');
|
|
|
|
/**
|
|
* Custom date format
|
|
*/
|
|
function apus_custom_date_format($format) {
|
|
return 'd/m/Y'; // Format: day/month/year
|
|
}
|
|
add_filter('date_format', 'apus_custom_date_format');
|
|
|
|
/**
|
|
* Include modular files
|
|
*/
|
|
// Sanitize Functions (load first to avoid redeclaration errors)
|
|
if (file_exists(get_template_directory() . '/inc/sanitize-functions.php')) {
|
|
require_once get_template_directory() . '/inc/sanitize-functions.php';
|
|
}
|
|
|
|
// Theme Options Helpers (load first as other files may depend on it)
|
|
if (file_exists(get_template_directory() . '/inc/theme-options-helpers.php')) {
|
|
require_once get_template_directory() . '/inc/theme-options-helpers.php';
|
|
}
|
|
|
|
// Admin Options API
|
|
if (is_admin()) {
|
|
if (file_exists(get_template_directory() . '/inc/admin/options-api.php')) {
|
|
require_once get_template_directory() . '/inc/admin/options-api.php';
|
|
}
|
|
if (file_exists(get_template_directory() . '/inc/admin/theme-options.php')) {
|
|
require_once get_template_directory() . '/inc/admin/theme-options.php';
|
|
}
|
|
}
|
|
|
|
// Bootstrap Nav Walker
|
|
if (file_exists(get_template_directory() . '/inc/nav-walker.php')) {
|
|
require_once get_template_directory() . '/inc/nav-walker.php';
|
|
}
|
|
|
|
// Bootstrap and Script Enqueuing
|
|
if (file_exists(get_template_directory() . '/inc/enqueue-scripts.php')) {
|
|
require_once get_template_directory() . '/inc/enqueue-scripts.php';
|
|
}
|
|
|
|
// Font customizer options
|
|
if (file_exists(get_template_directory() . '/inc/customizer-fonts.php')) {
|
|
require_once get_template_directory() . '/inc/customizer-fonts.php';
|
|
}
|
|
|
|
// SEO optimizations and Rank Math compatibility
|
|
if (file_exists(get_template_directory() . '/inc/seo.php')) {
|
|
require_once get_template_directory() . '/inc/seo.php';
|
|
}
|
|
|
|
// Schema.org JSON-LD implementation (Issue #33)
|
|
if (file_exists(get_template_directory() . '/inc/schema-org.php')) {
|
|
require_once get_template_directory() . '/inc/schema-org.php';
|
|
}
|
|
|
|
// Performance optimizations
|
|
if (file_exists(get_template_directory() . '/inc/performance.php')) {
|
|
require_once get_template_directory() . '/inc/performance.php';
|
|
}
|
|
|
|
// Critical CSS (optional, disabled by default)
|
|
if (file_exists(get_template_directory() . '/inc/critical-css.php')) {
|
|
require_once get_template_directory() . '/inc/critical-css.php';
|
|
}
|
|
|
|
// Image optimization
|
|
if (file_exists(get_template_directory() . '/inc/image-optimization.php')) {
|
|
require_once get_template_directory() . '/inc/image-optimization.php';
|
|
}
|
|
|
|
// Template functions
|
|
if (file_exists(get_template_directory() . '/inc/template-functions.php')) {
|
|
require_once get_template_directory() . '/inc/template-functions.php';
|
|
}
|
|
|
|
// Template tags
|
|
if (file_exists(get_template_directory() . '/inc/template-tags.php')) {
|
|
require_once get_template_directory() . '/inc/template-tags.php';
|
|
}
|
|
|
|
// Featured image functions
|
|
if (file_exists(get_template_directory() . '/inc/featured-image.php')) {
|
|
require_once get_template_directory() . '/inc/featured-image.php';
|
|
}
|
|
|
|
// Category badge functions
|
|
if (file_exists(get_template_directory() . '/inc/category-badge.php')) {
|
|
require_once get_template_directory() . '/inc/category-badge.php';
|
|
}
|
|
|
|
// AdSense delay loading
|
|
if (file_exists(get_template_directory() . '/inc/adsense-delay.php')) {
|
|
require_once get_template_directory() . '/inc/adsense-delay.php';
|
|
}
|
|
|
|
// Related posts functionality
|
|
if (file_exists(get_template_directory() . '/inc/related-posts.php')) {
|
|
require_once get_template_directory() . '/inc/related-posts.php';
|
|
}
|
|
|
|
// Related posts configuration options (admin helpers)
|
|
if (file_exists(get_template_directory() . '/inc/admin/related-posts-options.php')) {
|
|
require_once get_template_directory() . '/inc/admin/related-posts-options.php';
|
|
}
|
|
|
|
// Table of Contents
|
|
if (file_exists(get_template_directory() . '/inc/toc.php')) {
|
|
require_once get_template_directory() . '/inc/toc.php';
|
|
}
|
|
|
|
// APU Tables - Funciones para tablas de Análisis de Precios Unitarios (Issue #30)
|
|
if (file_exists(get_template_directory() . '/inc/apu-tables.php')) {
|
|
require_once get_template_directory() . '/inc/apu-tables.php';
|
|
}
|
|
|
|
// Desactivar búsqueda nativa (Issue #3)
|
|
if (file_exists(get_template_directory() . '/inc/search-disable.php')) {
|
|
require_once get_template_directory() . '/inc/search-disable.php';
|
|
}
|
|
|
|
// Desactivar comentarios (Issue #4)
|
|
if (file_exists(get_template_directory() . '/inc/comments-disable.php')) {
|
|
require_once get_template_directory() . '/inc/comments-disable.php';
|
|
}
|
|
|
|
// Social share buttons (Issue #31)
|
|
if (file_exists(get_template_directory() . '/inc/social-share.php')) {
|
|
require_once get_template_directory() . '/inc/social-share.php';
|
|
}
|
|
|
|
// CTA A/B Testing system (Issue #32)
|
|
if (file_exists(get_template_directory() . '/inc/cta-ab-testing.php')) {
|
|
require_once get_template_directory() . '/inc/cta-ab-testing.php';
|
|
}
|
|
|
|
// CTA Customizer options (Issue #32)
|
|
if (file_exists(get_template_directory() . '/inc/customizer-cta.php')) {
|
|
require_once get_template_directory() . '/inc/customizer-cta.php';
|
|
}
|