首页 文章

WordPress中元 Headers 的自定义位置<head>

提问于
浏览
0

我想在wordpress网站的头部更改/交换元 Headers 标签的位置 . 目前,我可以在主题的header.php中看到以下代码

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<?php wp_head(); ?>
</head>

看起来在 wp_head(); 函数中添加了 Headers 标记 . 如果我想在 <head> 开始标记之后立即移动/更改我的 Headers 和desription标记的位置,或者在头部区域中我想要的任何其他自定义位置 . 我可以't figure out in which file the title tag is being added. So that I can change it'的位置 .

1 回答

  • 0

    你在 wp-includes 文件夹中查了 default-filters.php 文件了吗? (WP-包括/默认-filters.php) . 找到下面的行并尝试更改它的位置并检查 .

    add_action( 'wp_head', '_wp_render_title_tag', 1);
    

相关问题