부등호(< 및 >)를 &lt; 및 &gt;로 변환하기

문자 '<' 및 '>'를 '&lt;' 및 '&gt;'로 변환하거나 반대로 변환할 수 있습니다. 원하는 변환 유형을 선택하고 텍스트를 입력하세요. 워드프레스에서 댓글에 HTML 태그를 입력하려는 경우 아래의 변환기를 사용하여 '<' 및 '>'를 '&lt;' 및 '&gt;'로 변환한 후에 복사하여 붙여넣기 하시기 바랍니다.

부등호(< , >)를 &lt , &gt로 변환하기

부등호(< , >)를 &lt ; 및 &gt ;로 변환하는 툴

워드프레스에서는 보안을 위해 보통 댓글에 HTML 태그가 허용되지 않습니다. HTML 태그를 입력하면 태그가 누락되어 코드가 제대로 입력되지 않습니다. 워드프레스에서 댓글을 달 때 HTML/PHP 코드를 입력할 때에는 <와 >를 &lt ; , &gt ;로 변환한 후에 입력하면 됩니다.

상기 툴을 사용하여 < , >를 &lt, &gt로 변환할 수 있고, 반대 방향으로도 변환이 가능합니다.

워드프레스 댓글에서 HTML 태그를 허용하고 싶은 경우 다음과 같은 코드를 차일드 테마의 함수 파일에 추가할 수 있습니다.

/**
 * Allows additional HTML tags in WordPress comments.
 *
 * @param array $allowedtags The array of default allowed tags.
 * @return array The modified array of allowed tags.
 */
function custom_allowed_comment_html_tags( $allowedtags ) {
    
    $new_tags = array(
        'a' => array(
            'href' => true,
            'title' => true,
        ),
        'br' => array(),
        'em' => array(),
        'strong' => array(),
        'pre' => array(),
        'p' => array(),
        'code' => array(),
    );

    // Merge the two arrays to include the new tags.
    return array_merge( $allowedtags, $new_tags );
}

add_filter( 'wp_kses_allowed_html', 'custom_allowed_comment_html_tags', 1, 1 );

이와 같은 코드를 사용하면 <a>, <br>, <em>, <strong>, <pre>, <p>, <code> 태그의 사용이 허용됩니다.

다른 도구...