WordPress主题制作

  1. 主页
  2. 文档
  3. WordPress主题制作
  4. functions.php制作(参考2020主题)
  5. functions.php的启动(setup)设置

functions.php的启动(setup)设置

作用:

设置主题默认值,注册支持项(theme_support)。

Sets up theme defaults and registers support for various WordPress features.

勾到 after_setup_theme 钩子上。

 

2020 theme setup包括的内容:

[cc lang=”php”]

add_theme_support( ‘automatic-feed-links’ );

add_theme_support(
‘custom-background’,
array(
‘default-color’ => ‘f5efe0’,
)
);

[/cc]

 

add_theme_support:12条

set_post_thumbnail_size:1条

register_nav_menus:1条

 

钩子:

add_action( ‘after_setup_theme’, ‘twentynineteen_setup’ );

这篇文章对您有用吗?

我们要如何帮助您?