마지막 업데이트 : 2022년 09월 15일
조회수 : 

워드프레스 카테고리에서 링크를 삭제하는 방법

방법 1 : Code Block을 이용한 방법 - TEXT <?php echo strip_tags( get_the_term_list( get_the_ID(), 'my_taxonomy', '', ', ' ) ) ?> 방법2 : Code Block을 이용하는 또 다른 방법 -DIV […]
Written by: doogak
  • 네이버 블로그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 트위터 공유하기
  • 카카오스토리 공유하기

방법 1 : Code Block을 이용한 방법 - TEXT

<?php echo strip_tags( get_the_term_list( get_the_ID(), 'my_taxonomy', '', ', ' ) ) ?>

방법2 : Code Block을 이용하는 또 다른 방법 -DIV

Code Block의 Width 값을 100%로 설정해야 함.

<?php
	$post_id = get_the_ID();

        $taxonomy= 'my_taxonomy';

	$terms = get_the_terms($post_id, $taxonomy);

	if ($terms) {
      $term_arr = array();

	    foreach ($terms as $term) {
          $name = $term->name;
          $term_arr[] = $name;
        }
      
      $my_terms = implode (", ", $term_arr);
      
    }
?>

<div class=""><?php echo $my_terms; ?></div>

방법3 : CSS를 이용하는 방법

요소에 클래스를 부여하고 pointer-events: none으로 설정함.

E.g:
.your-class a { pointer-events: none; }

 

  • 네이버 블로그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 트위터 공유하기
  • 카카오스토리 공유하기
power-switchmagnifiercross