각 페이지별 타이틀 설정 어떻게 해야 하는 건가요 ㅠ
본문
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>안녕하세요</title>
<meta name="안녕하세요 하이루">
<link href="/css/main_style.css" rel="stylesheet" type="text/css" />
<link href="/css/jp.css" rel="stylesheet" type="text/css" />
</head>
이런 식으로 php 파일이 만들어져 있고 이거를 공통 탑 메뉴로 사용하고 있습니다.
다른 페이지에서 이 php 파일을 탑 메뉴로 불러 오는데
<? include "../../page/common/head.php"; ?>
<? include "sub.php"; ?>
이런 식으로 불러 옵니다. 이럴 때 같은 타이틀을 전 페이지에 적용 시키기 때문에
구글 웹 마스터에서 같은 타이틀 반복 이라고 나옵니다. 어떻게 변경해야 될까요 ㅠ?
고수님들 조언 부탁드립니다. 가사합니다~
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>안녕하세요</title>
<meta name="안녕하세요 하이루">
<link href="/css/main_style.css" rel="stylesheet" type="text/css" />
<link href="/css/jp.css" rel="stylesheet" type="text/css" />
</head>
이런 식으로 php 파일이 만들어져 있고 이거를 공통 탑 메뉴로 사용하고 있습니다.
다른 페이지에서 이 php 파일을 탑 메뉴로 불러 오는데
<? include "../../page/common/head.php"; ?>
<? include "sub.php"; ?>
이런 식으로 불러 옵니다. 이럴 때 같은 타이틀을 전 페이지에 적용 시키기 때문에
구글 웹 마스터에서 같은 타이틀 반복 이라고 나옵니다. 어떻게 변경해야 될까요 ㅠ?
고수님들 조언 부탁드립니다. 가사합니다~
답변 2
<title>안녕하세요</title>
이 부분을 다음과 같이 바꾸세요. <?php if (!$title) $title = '안녕하세요'; ?>
<title><?php echo $title; ?></title>
그런 다음
<? include "../../page/common/head.php"; ?>
이 부분을 다음과 같이 바꾸세요. <?php $title = '페이지 타이틀';
include "../../page/common/head.php"; ?>
감사합니다!!! ^^ 많은 도움이 됬습니다
답변을 작성하시기 전에 로그인 해주세요.