洛阳市做网站贴吧,东莞网页网站制作,设计在线中国,可以直接打开网站的方法在主题开发中#xff0c;需要调用网站的logo#xff0c;最简单的办法就是用wp自带的函数#xff0c;那就是the_custom_logo()#xff0c;使用它还可以通过后台-自定义-logo#xff0c;边修改边预览#xff0c;还是很香的。 自定义徽标支持应首先使用add_theme_support()添…在主题开发中需要调用网站的logo最简单的办法就是用wp自带的函数那就是the_custom_logo()使用它还可以通过后台-自定义-logo边修改边预览还是很香的。 自定义徽标支持应首先使用add_theme_support()添加到主题中然后使用the_custom_logo()在主题中调用 直接上代码
1.在functions.php中 添加
// 自定义logo 在需要位置调用 the_custom_logo() function themename_custom_logo_setup() {$defaults array(height 100,width 400,flex-height true,flex-width true,header-text array( site-title, site-description ),);add_theme_support( custom-logo, $defaults ); //添加到主题中}add_action( after_setup_theme, themename_custom_logo_setup );2.在需要位置调用
?php the_custom_logo() ?
修改上传logo的方法后台——外观——自定义——logo