# AJAX 댓글 설정 문제

**URL:** <https://meta.discourse.org/t/issues-with-setting-up-ajax-comments/224455>\
**Category:** WordPress\
**Created:** [4월 16, 2022, 12:26오전 UTC](https://meta.discourse.org/t/issues-with-setting-up-ajax-comments/224455 "2022-04-16T00:26:29Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)\
**Post date:** [4월 18, 2022, 6:24오전 UTC](https://meta.discourse.org/t/issues-with-setting-up-ajax-comments/224455/4 "2022-04-18T06:24:48Z")

</div>

> [@haydenjames](#):
>
> 이제 작동하는 것 같지만, 포맷이 약간 우아하지 않네요. CSS를 알아봐야 하는 건가요?

네, 표시 방식은 테마에 따라 달라집니다. 플러그인 자체에는 최소한의 스타일링만 적용되어 있습니다.

> [@haydenjames](#):
>
> 또한, 오래된 WP 블로그 게시물에 대해 Discourse 포럼 홈페이지로 연결되는 “토론에 참여하기” 유형의 링크를 표시할 수 있는 방법이 있을까요? - 즉, 게시물에 댓글이 없거나 게시물이 이전에 Discourse로 동기화되지 않은 경우, 플러그인이 빈 상태로 두지 않고 대신 내 Discourse 포럼 홈페이지로 연결되는 일반적인 링크를 추가하길 원합니다.

연결되지 않은 주제에는 “토론에 참여하기” 링크가 표시되지 않습니다. 플러그인과 별개로 테마의 functions.php 파일에서 comments\_template 필터를 사용하여 직접 추가할 수 있습니다. 이 코드는 테스트하지 않았지만, 다음과 같은 코드가 작동할 것입니다:

```plaintext

use WPDiscourse\Utilities\Utilities as DiscourseUtilities;

function non_discourse_comments_template( $comment_template ) {
   global $post;
   $post_id = $post->ID;
   $discourse_post_id = get_post_meta( $post_id, 'discourse_post_id', true );

   if ($discourse_post_id) {
     return;
   } else {
     $options = DiscourseUtilities::get_options();
     $discourse_permalink = $options['url'];
     $link_text = "토론에 참여하기";
     return '<div class="wpdc-join-discussion"><a class="wpdc-join-discussion-link" href="' . esc_url_raw( $discourse_permalink ) . '" target="_blank" rel="noreferrer noopener">' . esc_html( $link_text ) . '</a></div>';
   }
}
add_filter( "comments_template", "non_discourse_comments_template" );

```

---

_[View the full topic](https://meta.discourse.org/t/issues-with-setting-up-ajax-comments/224455)._
