نعم، ستعتمد طريقة عرضه على السمة الخاصة بك. هناك تنسيق بسيط في المكون الإضافي نفسه.
لن يظهر رابط “انضم إلى المناقشة” في المواضيع غير المرتبطة. يمكنك إضافة شيء كهذا بنفسك، بشكل منفصل عن المكون الإضافي، عن طريق استخدام فلتر comments_template في ملف functions.php الخاص بالسمة الخاصة بك. لم أختبر هذا الرمز، ولكن شيئًا كهذا سيعمل:
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 = "Join the Discussion";
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" );