요즘 워드프레스 템플릿이 뭐하나 바꾸기가 참 어렵게 되어있죠? 파비콘을 하나 넣으려니 참 이게 안되네요. 그래서 그냥 코드에 박아버렸습니다. 권장하는 방법은 아니에요. 워드프레스 업그레이드하면 지워지거든요. 워드프레스 템플릿만들기 강좌 끝나면 적합한 방법을 다시 알려드리겠습니다. 이건 그냥 임시방편으로 사용하실수 있는 코딩이에요. 일단 워드프레스 사이트를 파일매니저로 여시면 wp-includes라는 폴더가 있을거에요. 그 안에 template-canvas.php라는 파일을 여세요. 그러면 아래와 같이 <link rel="shortcut icon" href="favicon.ico">
태그를 넣으셔서 파비콘을 임시로 보여주게 만들수 있어요. 물론 루트폴더에 favicon.ico
을 넣으셔야 나오겠죠?
<?php
/**
* Template canvas file to render the current 'wp_template'.
*
* @package WordPress
*/
/*
* Get the template HTML.
* This needs to run before <head> so that blocks can add scripts and styles in wp_head().
*/
$template_html = get_the_block_template_html();
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<link rel="shortcut icon" href="favicon/favicon.ico">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<?php echo $template_html; ?>
<?php wp_footer(); ?>
</body>
</html>