썸머노트 엔터시 P자동 추가 해제 방법 궁금합니다.

썸머노트에서 엔터 줄바꿈시 P가 자동추가 되어 레이아웃이 깨집니다.

CSS로 간격을 좁혀서 볼 수는 있지만 

게시판>고급>양식을 사용하고 있고 메모장에 있는 내용을 복붙하면 P태그가 자동으로 들어가

형태가 깨집니다. 하여 아래와 같이 코드를 삽입해도 문제가 해결되지 않습니다.

 

방법1)

add_filter( 'sanitize_file_name', 'mb_strtolower' );

add_filter( 'the_content', 'remove_autop_tags_from_summernote_editor' );
function remove_autop_tags_from_summernote_editor( $content ) {
    $content = str_replace( '<p><br></p>', '', $content );
    return $content;
}

 

방법2)

function clear_p($content){
return str_replace("</p>","<p clear='none'/>", $content);
}
add_filter('the_content', 'clear_p');


방법3)

remove_filter('the_content', 'wpautop');
remove_filter('the_excerpt', 'wpautop');
remove_filter('widget_text_content', 'wpautop');
remove_filter('the_twput', 'wpautop');

 

 

방법4) 이 방법으로 코드 삽입시 기본 클래식 에디터에서 엔터 줄바꿈 사용시 P가 추가되지 않아 좋았지만

여진히 썸머노트에서는 적용되지 않습니다.

add_filter('tiny_mce_before_init','change_mce_options', 10, 1);
function change_mce_options($init){
	$init["forced_root_block"] = false;
	$init["force_br_newlines"] = true;
	$init["force_p_newlines"] = false;
	$init["convert_newlines_to_brs"] = true;
	return $init;
}

 

 

좀 더 명확하게 어떤 코드를 어떤 경로의 PHP 파일에 추가하거나 변경해야 하는지 도움을 구합니다.

부탁드립니다.

워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기