Implementar Issues #2-4, #8-13, #16 - Funcionalidades core del tema
Implementación masiva de funcionalidades esenciales del tema apus-theme usando agentes paralelos para máxima eficiencia. **Issues Completados:** **Issue #2 - Eliminar bloat de WordPress:** - inc/performance.php: 13 funciones que remueven emojis, oEmbed, feeds, dashicons, jQuery migrate, XML-RPC, etc. - Optimización completa del frontend **Issue #3 - Desactivar búsqueda nativa:** - inc/search-disable.php: Bloquea queries de búsqueda, widget, formularios - search.php: Retorna 404 con mensaje amigable **Issue #4 - Desactivar comentarios:** - inc/comments-disable.php: 15 funciones que eliminan comentarios de frontend y backend - comments.php: Template desactivado **Issue #8 - Footer con 4 widgets:** - footer.php: Verificado con 4 áreas de widgets y copyright - assets/css/footer.css: Estilos responsive completos - Sistema de anchos configurables **Issue #9 - Jerarquía de plantillas:** - home.php, category.php, tag.php, author.php, date.php, taxonomy.php, attachment.php - 7 nuevas plantillas + 12 verificadas - Template parts completos - Paginación en todos los archives **Issue #10 - Imágenes destacadas:** - inc/featured-image.php: 12 funciones para manejo de featured images - Sin placeholders, lazy loading, alt text automático - Responsive con Bootstrap, aspect ratio **Issue #11 - Badge de categoría:** - inc/category-badge.php: Badge Bootstrap sobre H1 en single posts - Excluye "Uncategorized" - Template tag: apus_display_category_badge() **Issue #12 - TOC automático:** - inc/toc.php: Genera TOC desde H2/H3 - assets/css/toc.css: Estilos con numeración CSS counters - assets/js/toc.js: Smooth scroll, scroll spy, toggle - Configurable con apus_get_option() **Issue #13 - Posts relacionados:** - inc/related-posts.php: Query por categoría, 12 funciones - inc/admin/related-posts-options.php: Sistema de configuración - assets/css/related-posts.css: Cards responsive - Hook automático en single posts **Issue #16 - AdSense delay:** - inc/adsense-delay.php: Retardo de carga hasta scroll/click - assets/js/adsense-loader.js: Detecta interacciones - Mejora FID y TBT para Core Web Vitals **Archivos Modificados:** - functions.php: Includes de nuevos módulos, removido feed support - single.php: Integración de category badge - inc/enqueue-scripts.php: Enqueue de nuevos assets - inc/theme-options-helpers.php: Helper functions para TOC **Archivos Creados:** - 7 nuevas plantillas WordPress - 3 nuevos módulos inc/ (comments-disable, search-disable) - 8 reportes de documentación .md **Estadísticas:** - Total funciones PHP: 60+ nuevas funciones - Líneas de código: 2,500+ líneas - Archivos nuevos: 18 - Archivos modificados: 9 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -79,13 +79,19 @@ function apus_generate_heading_id($text, $index) {
|
||||
* @return string HTML for the table of contents
|
||||
*/
|
||||
function apus_generate_toc($headings) {
|
||||
if (empty($headings) || count($headings) < 2) {
|
||||
return ''; // Don't show TOC if there are fewer than 2 headings
|
||||
// Get minimum headings required from theme options
|
||||
$min_headings = (int) apus_get_option('toc_min_headings', 2);
|
||||
|
||||
if (empty($headings) || count($headings) < $min_headings) {
|
||||
return ''; // Don't show TOC if there are fewer headings than required
|
||||
}
|
||||
|
||||
$toc_html = '<nav class="apus-toc" aria-label="' . esc_attr__('Table of Contents', 'apus-theme') . '">';
|
||||
// Get custom TOC title from theme options
|
||||
$toc_title = apus_get_toc_title();
|
||||
|
||||
$toc_html = '<nav class="apus-toc" aria-label="' . esc_attr($toc_title) . '">';
|
||||
$toc_html .= '<div class="apus-toc-header">';
|
||||
$toc_html .= '<h2 class="apus-toc-title">' . esc_html__('Table of Contents', 'apus-theme') . '</h2>';
|
||||
$toc_html .= '<h2 class="apus-toc-title">' . esc_html($toc_title) . '</h2>';
|
||||
$toc_html .= '<button class="apus-toc-toggle" aria-expanded="true" aria-controls="apus-toc-list">';
|
||||
$toc_html .= '<span class="toggle-icon" aria-hidden="true"></span>';
|
||||
$toc_html .= '<span class="screen-reader-text">' . esc_html__('Toggle Table of Contents', 'apus-theme') . '</span>';
|
||||
@@ -183,6 +189,13 @@ function apus_add_heading_ids($content) {
|
||||
* Hooks into apus_before_post_content to display TOC on single posts.
|
||||
*/
|
||||
function apus_display_toc() {
|
||||
// Check if TOC is enabled in theme options
|
||||
$toc_enabled = apus_get_option('enable_toc', true);
|
||||
|
||||
if (!$toc_enabled) {
|
||||
return; // TOC disabled in theme options
|
||||
}
|
||||
|
||||
// Only show on single posts
|
||||
if (!is_single()) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user