// Output clean Google Scholar meta in with no stray indentation add_action('wp_head', function () { // Limit to specific post types $allowed = array('keytopics','snapshot_reports','fact_sheets','annual_reports','trends_reports','national_survey'); if (!is_singular($allowed)) return; // PDF (ACF 'file_kt') $file = get_field('file_kt'); $pdf = (is_array($file) && !empty($file['url'])) ? esc_url($file['url']) : ''; // Publisher (ACF 'publisher') string or array $publisher = get_field('publisher'); if (is_array($publisher)) { $publisher = implode('; ', array_filter(array_map(static function($v){ return trim(wp_strip_all_tags((string)$v)); }, $publisher))); } else { $publisher = trim(wp_strip_all_tags((string)$publisher)); } // Language ISO-2 (en, fr, de…) $lang = substr((string) get_bloginfo('language'), 0, 2); // Collect authors (from flexible layout 'author_doi_isbn') $authors = array(); if (have_rows('flexibles')) { while (have_rows('flexibles')) { the_row(); if (get_row_layout() === 'author_doi_isbn') { if (have_rows('authors', get_the_ID())) { while (have_rows('authors', get_the_ID())) { the_row(); $a = trim(wp_strip_all_tags((string) get_sub_field('author'))); if ($a !== '') $authors[] = $a; } } else { $txt = get_sub_field('authors'); if (is_string($txt) && $txt !== '') { foreach (array_map('trim', explode(',', $txt)) as $a) { $a = trim(wp_strip_all_tags($a)); if ($a !== '') $authors[] = $a; } } } } } } // Build lines (no leading spaces) $out = array(); $out[] = ''; $out[] = ''; $out[] = ''; if ($pdf) { $out[] = ''; $out[] = ''; } if ($publisher !== '') { $out[] = ''; } $out[] = ''; foreach ($authors as $a) { $out[] = ''; } $out[] = ''; echo "\n".implode("\n", $out)."\n"; }, 1); Publications - IEA-PVPS

Publications

Filter

Year
Task