본문 바로가기
WP

워드프레스 페이지별로 헤더이미지 class 바꾸기

by 영감은어디에 2024. 4. 30.

한 템플릿안에서 페이지별로 상단 배경 이미지만 바꾸고 싶을때

<?php if(is_page(2017)):?>
	<div class="sub-pagetitlebox2">
		<h2><?php the_title(); ?></h2>
	</div>
<?php elseif(is_page(16)):?>
	<div class="sub-pagetitlebox">
		<h2><?php the_title(); ?></h2>
	</div>
<?php else:?>
	<div class="sub-pagetitlebox">
		<h2><?php the_title(); ?></h2>
	</div>
<?php endif?>