페이지마다 head에 있는 meta description을 다르게 하고싶은데 어떤 방법이 있을까요 ..?
<head>
<meta name-"description" content="<? $meta_desc ?>"/>
</head>
<?
if ($bo_tabble = "해당 게시판이면") {
$meta_desc = "메타태그를 이렇게 설정해";
}
?>
이렇게 해도 될까요 ..?
답변 3개 / 댓글 1개
<?php
if($bo_table == 'tablename'){
$meta_desc = "내용";
}
<meta name="description" content="<?php echo $meta_desc ?>"/>
이런식으로 하세요.
$('meta[property="og:description"]').attr('content',"<?php echo $meta_desc;?>" );
jquery로 $meta_desc의 조건에 따라서 meta tag를 동적으로 변경하게 하면 되지 않을까요.
네 그렇게 php if문을 해당 meta태그보다 위쪽에 위치하도록만 하면 되겠네요
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.