ADD Archive documentos
This commit is contained in:
@@ -85,7 +85,7 @@ class StarterSite extends Site {
|
||||
}, 10, 2);
|
||||
/** FIN *************POST "QUÉ ES LA CNT" */
|
||||
|
||||
// archive-videos
|
||||
// paginación y todos los archivos sin tener en cuenta el idioma -> archive-videos
|
||||
add_action('pre_get_posts', function($query) {
|
||||
if (!is_admin() && $query->is_main_query() && is_post_type_archive('videos')) {
|
||||
$query->set('posts_per_page', 16);
|
||||
@@ -97,6 +97,14 @@ class StarterSite extends Site {
|
||||
add_action('wp_ajax_get_page_content', [$this, 'get_page_content_ajax']);
|
||||
add_action('wp_ajax_nopriv_get_page_content', [$this, 'get_page_content_ajax']);
|
||||
add_action('template_redirect', [$this, 'redirect_subpaginas_acerca']);
|
||||
|
||||
// Tag añadido en CF7 formularios para saber qué ciudad es.
|
||||
add_filter('wpcf7_form_tag', function($tag) {
|
||||
if ($tag['name'] === 'title') {
|
||||
$tag['values'][] = get_the_title();
|
||||
}
|
||||
return $tag;
|
||||
}, 10, 1);
|
||||
|
||||
// *** SOLO USAR UNA VEZ PARA LIMPIAR. NO FUNCIONABA LA PAGINACIÓN DE SEARCH.
|
||||
// add_action('init', function() {
|
||||
@@ -105,10 +113,7 @@ class StarterSite extends Site {
|
||||
// 'index.php?paged=$matches[1]',
|
||||
// 'top'
|
||||
// );
|
||||
|
||||
// // Solo ejecuta una vez, luego comenta estas líneas
|
||||
// error_log('✅ flush rewrite rules');
|
||||
|
||||
// flush_rewrite_rules(false);
|
||||
// }, 10);
|
||||
|
||||
@@ -314,6 +319,7 @@ class StarterSite extends Site {
|
||||
|
||||
// Si no hay videos en euskera, el botón euskera no detecta videos en ese idioma y te lleva a la home.
|
||||
if (is_post_type_archive('videos')) {
|
||||
error_log('archive videos');
|
||||
foreach ($polylang_data['languages'] as $slug => &$lang) {
|
||||
if ($slug === 'es') {
|
||||
$lang['url'] = home_url('/es/videos/');
|
||||
@@ -323,6 +329,18 @@ class StarterSite extends Site {
|
||||
}
|
||||
}
|
||||
|
||||
// Si no hay videos en euskera, el botón euskera no detecta videos en ese idioma y te lleva a la home.
|
||||
if (is_post_type_archive('documento')) {
|
||||
error_log('archive documentos');
|
||||
foreach ($polylang_data['languages'] as $slug => &$lang) {
|
||||
if ($slug === 'es') {
|
||||
$lang['url'] = home_url('/es/documentos/');
|
||||
} elseif ($slug === 'eu') {
|
||||
$lang['url'] = home_url('/eu/dokumentuak/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $polylang_data;
|
||||
}
|
||||
|
||||
@@ -728,7 +746,7 @@ class StarterSite extends Site {
|
||||
//Otras páginas
|
||||
$context['SubpaginasAcercaCnt'] = $this->getSubpaginasAcercaCnt();
|
||||
//$context['paginas_acerca'] = $this->getPaginasAcerca();
|
||||
$context['documentos'] = $this->getDocumentos();
|
||||
//$context['documentos'] = $this->getDocumentos();
|
||||
$context['enlaces'] = $this->getEnlaces();
|
||||
$context['contacto_info'] = $this->getContactoFields();
|
||||
$context['posts_industry'] = $this->getPostIndustry();
|
||||
|
||||
Reference in New Issue
Block a user