Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Link odpowiedzi do komantarza w Wordpressie
Forum PHP.pl > Forum > Gotowe rozwiązania > Systemy portalowe i CMS'y
AboutMe
Witam,

Próbuję wrzucić to:
  1. <?php comment_reply_link() ?>


do pliku comments.php

ale nie widzę żadnego linku do odpowiedzi

Z tymi fukcjami nie ma problemu:
  1. <?php comment_author_link(); ?>
  2. <?php comment_date(); ?>
  3. <?php comment_time(); ?>


tylko z tym nieszczęsnym linkiem
erix
Pokaż lepiej, jak w CAŁOŚCI to wrzuciłeś. Mam na myśli cały ten kod, z pliku comments. Bo są pewne ograniczenia. winksmiley.jpg
AboutMe
Wygląda to mniej więcej tak:

  1. <div class="commentlist">
  2. <?php foreach($comments as $comment) : ?>
  3. <li id="comment-<?php comment_ID(); ?>">
  4. <?php if ($comment->comment_approved == '0') : ?>
  5. <p>Your comment is awaiting approval</p>
  6. <?php endif; ?>
  7.  
  8. <?php echo get_avatar(get_comment_author_email(), $size = '80', $default_avatar ); ?>
  9.  
  10. <div class="comment-body">
  11. <div class="comment-meta"><?php comment_author_link(); ?> on <?php comment_date(); ?> at <?php comment_time(); ?> says: </div>
  12. <div class="comment-text"><?php comment_text(); ?></div>
  13.  
  14. <?php comment_reply_link(); ?>
  15.  
  16.  
  17. </div>
  18. <div class="clear"> </div>
  19. </li>
  20. <?php endforeach; ?>
  21.  
  22. </div><!-- commentlist-->







a cały plik wygląda tak:


  1. <?php
  2. /**
  3.  * @package WordPress
  4.  * @subpackage Default_Theme
  5.  */
  6.  
  7. // Do not delete these lines
  8. if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  9. die ('Please do not load this page directly. Thanks!');
  10.  
  11. if ( post_password_required() ) { ?>
  12. <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
  13. <?php
  14. return;
  15. }
  16. ?>
  17.  
  18. <!-- You can start editing here. -->
  19.  
  20. <?php if ( have_comments() ) : ?>
  21. <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3>
  22.  
  23. <div class="navigation">
  24. <div class="alignleft"><?php previous_comments_link() ?></div>
  25. <div class="alignright"><?php next_comments_link() ?></div>
  26.  
  27. </div>
  28.  
  29. <div class="commentlist">
  30. <?php foreach($comments as $comment) : ?>
  31. <li id="comment-<?php comment_ID(); ?>">
  32. <?php if ($comment->comment_approved == '0') : ?>
  33. <p>Your comment is awaiting approval</p>
  34. <?php endif; ?>
  35.  
  36. <div class="comment-gravatar"><?php echo get_avatar(get_comment_author_email(), $size = '80', $default_avatar ); ?></div>
  37.  
  38. <div class="comment-body">
  39. <div class="comment-meta"><?php comment_author_link(); ?> on <?php comment_date(); ?> at <?php comment_time(); ?> says: </div>
  40. <div class="comment-text"><?php comment_text(); ?></div>
  41.  
  42. <?php comment_reply_link(); ?>
  43.  
  44.  
  45. </div>
  46. <div class="clear"> </div>
  47. </li>
  48. <?php endforeach; ?>
  49.  
  50. </div><!-- commentlist-->
  51.  
  52. <div class="navigation">
  53. <div class="alignleft"><?php previous_comments_link() ?></div>
  54. <div class="alignright"><?php next_comments_link() ?></div>
  55. </div>
  56. <?php else : // this is displayed if there are no comments so far ?>
  57.  
  58. <?php if ( comments_open() ) : ?>
  59. <!-- If comments are open, but there are no comments. -->
  60.  
  61. <?php else : // comments are closed ?>
  62. <!-- If comments are closed. -->
  63. <p class="nocomments"> </p>
  64.  
  65. <?php endif; ?>
  66. <?php endif; ?>
  67.  
  68.  
  69.  
  70.  
  71.  
  72. <?php if ( comments_open() ) : ?>
  73.  
  74. <?php global $user_email,$post_id,$aria_req; $defaults_comment_settings = array( 'fields' => apply_filters( 'comment_form_default_fields', array(
  75.  
  76. 'respond-info-begin' => '<div class="respond-comment-set-wrap">' . '<div class="respond-info-wrap">' . '<div id="fields">',
  77. 'author' => '<p class="comment-form-author">' .
  78. '<input id="author" name="author" type="text" value="' .
  79. esc_attr( $commenter['comment_author'] ) . '" size="22" tabindex="1"' . $aria_req . ' />' .
  80. '<small for="author">' . __( ' Name' ) . '</small> ' .
  81. ( $req ? '<small class="required">*</small>' : '' ) .
  82. '</p>',
  83. 'email' => '<p class="comment-form-email">' .
  84. '<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="22" tabindex="2"' . $aria_req . ' />' .
  85. '<small for="email">' . __( ' E-Mail Address' ) . '</small> ' .
  86. ( $req ? '<small class="required">*</small>' : '' ) .
  87. '</p>',
  88. 'url' => '<p class="comment-form-url">' .
  89. '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="22" tabindex="3" />' .
  90. '<small for="url">' . __( ' Website/Blog URL' ) . '</small>' .
  91. '</p>',
  92. 'respond-info-end' => '</div><!-- .respond-info --></div><!-- .respond-info-wrap -->' ) ),
  93.  
  94. 'comment_field' => '<div class="respond-comment">' .
  95. '<div class="comment-form-comment">' .
  96. '<textarea id="comment" name="comment" cols="65" rows="10" tabindex="4" aria-required="true"></textarea>' .
  97. '</div><!-- #form-section-comment .form-section -->' .
  98. '</div><!-- .respond-comment -->' . '</div><!-- .respond-comment-set-wrap -->' . '<div class="clearfix"></div>',
  99. 'must_log_in' => '<div class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</div>',
  100. 'logged_in_as' => '<div class="respond-comment-set-wrap">' .
  101. '<div class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%s">%s</a>. <a href="%s" title="Log out of this account">Log out</a></div>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ),
  102. 'comment_notes_before' => '',
  103. 'comment_notes_after' => '',
  104. 'title_reply' => __( 'Leave a Reply' ),
  105. 'title_reply_to' => __( 'Leave a Reply to %s' ),
  106. 'cancel_reply_link' => __( 'Cancel reply' ),
  107. 'label_submit' => __( 'SUBMIT COMMENT' ),
  108. );
  109. comment_form($defaults_comment_settings); ?>
  110.  
  111.  
  112. <?php endif; // if you delete this the sky will fall on your head ?>
erix
A jaka wersja WP?
AboutMe
Najnowsza
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.