Customize the structure of WP Discourse templates

수정:

동일한 문제를 겪고 있는 분들을 위해 작동하는 방법을 찾았고, 아래에 올바른 코드를 붙여넣었습니다:

@angus 조금 읽어본 끝에 WP Discourse 댓글에서 Gravatar 크기를 재정의할 수 있는 위치를 찾았습니다.

제 functions.php 파일에 아래 코드를 추가했지만(오류 발생/아래 참조):

// Customizes the comment_html template.

function my_wpd_comment_html( $input ) {
		ob_start();
		?>
		<li class="comment <?php echo $even ? 'even' : 'odd'; ?> depth-1">
			<article class="comment-body">
				<footer class="comment-meta">
					<div class="comment-author vcard">
						<img alt="Avatar for {username}" src="{avatar_url}" class="avatar avatar-64 photo avatar-default"
							 height="24"
							 width="24">
						<b class="fn"><a href="{topic_url}" rel="external"
										 class="url">{username}</a></b>
						<span class="says screen-reader-text"><?php echo esc_html( 'says:', 'wp-discourse' ); ?></span><!-- screen reader text -->
					</div>
					<div class="comment-metadata">
						<time datetime="{comment_created_at}">{comment_created_at}</time>
					</div>
				</footer>
				<div class="comment-content">{comment_body}</div>
			</article>
		</li>
		<?php
		$output = ob_get_clean();
 return $output;
	}

// Hook into the function from the plugin's code.
add_filter(  'discourse_comment_html', 'my_wpd_comment_html' );

수정: 이제 작동합니다!
하지만 500 오류가 발생합니다. 오류 표시가 활성화되어 있지 않습니다. 문법 오류를 확인하기 위해 샌드박스 환경을 설정하고 지금 진행 중입니다. 하지만 명백한 수정 사항이 있을 수 있으므로 코드를 여기에 게시해 두었습니다.

감사합니다

1개의 좋아요