Clean funciones documentos y acerca
This commit is contained in:
@ -380,59 +380,6 @@ class StarterSite extends Site {
|
||||
return $logos;
|
||||
}
|
||||
|
||||
// Recoge los posts del Post Type (ACF) Acerca
|
||||
// private function getPaginasAcerca() {
|
||||
// return Timber::get_posts([
|
||||
// 'post_type' => 'acerca',
|
||||
// 'post_status' => 'publish',
|
||||
// 'orderby' => 'menu_order',
|
||||
// 'order' => 'ASC',
|
||||
// 'posts_per_page' => -1,
|
||||
// ]);
|
||||
// }
|
||||
|
||||
private function getDocumentos() {
|
||||
|
||||
$args = ([
|
||||
'post_type' => 'documento',
|
||||
'post_status' => 'publish',
|
||||
'orderby' => 'menu_order',
|
||||
'order' => 'ASC',
|
||||
'posts_per_page' => -1,
|
||||
'lang' => '',
|
||||
]);
|
||||
|
||||
$posts = Timber::get_posts($args);
|
||||
//error_log('✅ Número de posts "Documentos" encontrados: ' . count($posts));
|
||||
|
||||
$documentos = [];
|
||||
|
||||
foreach ($posts as $post) {
|
||||
$doc = [
|
||||
'id' => $post->ID,
|
||||
'title' => $post->title,
|
||||
'link' => $post->link,
|
||||
'content' => $post->content,
|
||||
'excerpt' => $post->excerpt,
|
||||
'lang' => pll_get_post_language($post->ID),
|
||||
];
|
||||
|
||||
$archivo = get_field('documento', $post->ID);
|
||||
|
||||
if ($archivo && is_array($archivo)) {
|
||||
$doc['documento_url'] = $archivo['url'] ?? '';
|
||||
$doc['documento_filename'] = $archivo['filename'] ?? '';
|
||||
$doc['documento_filesize'] = size_format($archivo['filesize'] ?? 0);
|
||||
$doc['documento_extension'] = pathinfo($archivo['filename'] ?? '', PATHINFO_EXTENSION);
|
||||
$doc['thumbnail'] = get_the_post_thumbnail_url($post->ID, 'medium');
|
||||
}
|
||||
|
||||
$documentos[] = $doc;
|
||||
}
|
||||
|
||||
return $documentos;
|
||||
}
|
||||
|
||||
private function getEnlaces() {
|
||||
|
||||
$grupos = [];
|
||||
@ -745,8 +692,6 @@ class StarterSite extends Site {
|
||||
|
||||
//Otras páginas
|
||||
$context['SubpaginasAcercaCnt'] = $this->getSubpaginasAcercaCnt();
|
||||
//$context['paginas_acerca'] = $this->getPaginasAcerca();
|
||||
//$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