// Adiciona suporte ao AMP add_theme_support( 'amp', array( 'nav_menu_toggle' => array( 'nav_container_id' => 'site-navigation', 'nav_container_toggle_class' => 'toggled-on', 'menu_button_id' => 'site-navigation-toggle', 'menu_button_toggle_class' => 'toggled-on', ), ) ); // Código head add_action('wp_head', function () { if (!get_query_var('amp')) return; $amp_code_head = get_theme_mod('amp_code_head'); if ($amp_code_head) { echo str_ireplace('[CANONICAL]', get_permalink(), $amp_code_head); } }, 999); // Código body add_action('wp_body_open', function () { if (!get_query_var('amp')) return; $amp_code_body = get_theme_mod('amp_code_body'); if ($amp_code_body) { echo str_ireplace('[CANONICAL]', get_permalink(), $amp_code_body); } }, 99); // Código do rodapé add_action('wp_footer', function () { if (!get_query_var('amp')) return; $amp_code_footer = get_theme_mod('amp_code_footer'); if ($amp_code_footer) { echo str_ireplace('[CANONICAL]', get_permalink(), $amp_code_footer); } }, 99); // Desabilita a funcionalidade de vinculação de AMP para AMP add_filter('amp_to_amp_linking_enabled', '__return_false'); // Remove "&" dos links caso seja uma página de post (single.php) add_filter('the_permalink', function ($permalink) { if (is_single()) { $permalink = str_replace('&', '', $permalink); } return $permalink; }, 99); Maluma – Rap Mais

Maluma