Problem with a comment on a post

Discussion in 'WordPress' started by kojokroavi, Aug 24, 2012.

  1. #1
    Maybe someone knows how I fix the issue post comments. I attach a screenshot. My site arranged so that posts will be written as a page, now I asked someone to write a comment on a post of mine (I'm basically still not published the site), and I wrote a response to his response, which is fine, the question is, how do I hide the so-called "Leave a Reply "I want it will only appear if someone wants to write a comment, is it possible?. 1.jpg
     
    kojokroavi, Aug 24, 2012 IP
  2. affilorama

    affilorama Active Member

    Messages:
    1,896
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Hi kojokroavi,

    I think you can edit that line in the comments. php to say something else like "Tell Me What You Think" instead of "Leave a Reply". But you cannot take it out completely.

    Hope that helps. Have a good day!
     
    affilorama, Aug 24, 2012 IP
  3. kojokroavi

    kojokroavi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Are you sure it can not hide , and only if someone wants to comment, then he press a button and comment?.
     
    kojokroavi, Aug 24, 2012 IP
  4. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #4
    Do you want to display the comment form after clicking a button or just removing the phrase "Leave a Reply"? Please elaborate.
     
    Devtard, Aug 24, 2012 IP
  5. kojokroavi

    kojokroavi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I wrote a new post, I am attaching a Screenshot,in the Screenshot I marked the new post in a red circle, I marked the option to respond in a green circle , and Now I will click on it to respond :

    http://www.siz.co.il/my/mi3mt4yj3wng.png

    I attach a second screenshot ,Here I marked the new post in red circle ,The response to my post I marked in green circle,What I marked in purple I want to hide In such a way that only if someone wants to respond then it will be a button that is clicked:

    http://www.siz.co.il/my/mtwvzdc5zzhn.png

    Is it possible to do this.

    I hope that the explanation was better
     
    kojokroavi, Aug 24, 2012 IP
  6. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #6
    Devtard, Aug 24, 2012 IP
  7. ashwini.gangamwar

    ashwini.gangamwar Member

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    38
    #7
    Same thing happend with me, i edit my comment but that was hidden.
     
    ashwini.gangamwar, Aug 24, 2012 IP
  8. kojokroavi

    kojokroavi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thank you
    Only did not understand where I should put the code in the link?.
    I'm new at WordPress
     
    kojokroavi, Aug 24, 2012 IP
  9. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #9
    Paste here the content of both files, I'll show you how to make it work.

    (Also make sure that all important phrases in your template are in English, I do not understand Hebrew.)
     
    Devtard, Aug 24, 2012 IP
  10. kojokroavi

    kojokroavi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10

    Where Are the files comments.php and single.php existing?.
     
    kojokroavi, Aug 24, 2012 IP
  11. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #11
    You can access them via your FTP client (wp-content/themes) or you can view them in the Theme Editor (WP Admin -> Appearance).
     
    Devtard, Aug 24, 2012 IP
  12. kojokroavi

    kojokroavi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I think I found it under /wp-content/themes/the-theme-name/


    text/x-generic comments.php
    PHP script text

    <?php
    /*
    * Comments Template
    */
    ?>

    <div id="comments">
    <?php if ( post_password_required() ) : ?>
    <p class="nopassword"><?php _e('Protected Comments: Please enter your password to view comments.', 'northern'); ?></p>
    </div>
    <?php
    return;
    endif;
    ?>

    <?php if ( have_comments() ) : ?>
    <h3 id="comments-title">
    <?php comments_number( 'Leave a comment', __( '1 Comment to', 'northern' ), __( '% Comments to', 'northern' ) ) ?> <?php the_title(); ?>
    </h3>

    <ol class="commentlist">
    <?php wp_list_comments(); ?>
    </ol>

    <?php if ( get_comment_pages_count() > 1 && get_option('page_comments') ) : ?>
    <section class="pagenav">
    <?php previous_comments_link( __( '&laquo; Older Comments', 'northern' ) ); ?> - <?php next_comments_link( __( 'Newer Comments &raquo;', 'northern' ) ); ?>
    </section>
    <?php endif; ?>

    <?php endif; // end have_comments() ?>

    <?php comment_form(); ?>
    </div>





    And here's another folder




    text/x-generic single.php
    PHP script text

    <?php
    get_header();
    ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <h2 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>

    <article <?php post_class(); ?> id="post-<?php the_ID(); ?>">

    <?php the_post_thumbnail('thumbnail'); ?>

    <div class="meta">
    <?php edit_post_link(__('Edit This', 'northern')); ?>
    <ul>
    <li><?php northern_the_breadcrumb(); ?></li>
    <li><?php _e("Published on:", 'northern'); ?> <a href="<?php the_permalink() ?>" rel="bookmark"><?php echo the_time("l - d F Y"); ?></a></li>
    <li><?php _e("Categories:", 'northern'); ?> <?php the_category(', ') ?> <?php the_tags(__('Tags:&nbsp;', 'northern'), ' , ' , ''); ?></li>
    </ul>
    </div>

    <?php the_content(__('(more...)', 'northern')); ?>

    <div class="commentlink">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('No Comments', 'northern'), __('1 Comment', 'northern'), __('% Comments', 'northern'), '', __('Comments are closed.', 'northern') ); ?>
    </div>

    </article>

    <?php endwhile; endif; ?>

    <?php comments_template( '', true ); ?>

    <section class="pagenav">
    <span class="previous"><?php previous_post_link('%link'); ?></span> - <span class="next"><?php next_post_link('%link'); ?></span>
    </section>

    </section>

    <?php get_sidebar(''); ?>

    <?php get_footer(); ?>
     
    kojokroavi, Aug 24, 2012 IP
  13. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #13
    I do not know where is the link (that would show the comment form) located, so you have to find it yourself (it should be placed in the file single.php - I have it there in my own theme but I cannot find it in yours) and change it to the form that is described on the page I posted above.

    <a href="#" onclick="toggle_visibility('foo');">Leave a comment!</a>
    Code (markup):
    Add this code before the link:

    <script type="text/javascript">
    <!--
        function toggle_visibility(id) {
           var e = document.getElementById(id);
           if(e.style.display == 'block')
              e.style.display = 'none';
           else
              e.style.display = 'block';
        }
    //-->
    </script>
    Code (markup):
    Then find <?php comment_form(); ?> (comments.php) and replace it with this:

    <div id="foo">
    <?php comment_form(); ?>
    </div>
    Code (markup):
    Then the comment form should appear only when you click the link.
     
    Devtard, Aug 24, 2012 IP
  14. kojokroavi

    kojokroavi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I have to tell you that my site is installed on the storage server directly, and all the files are there.
    I was looking for these files in the path I mentioned, did you find this file on this path in your site?.
    the path : /wp-content/themes/the-theme-name/
     
    kojokroavi, Aug 24, 2012 IP
  15. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #15
    Yes, the path is same for all WP installations. You just have to edit files of currently active theme. If you don't, there won't be any changes made on your site.
     
    Devtard, Aug 24, 2012 IP
  16. kojokroavi

    kojokroavi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Is this line you gave me


    <a href="#" onclick="toggle_visibility('foo');">Leave a comment!</a>


    I need to find in my file single.php ?.

    If so, I can not find it, I do not know where that line is....
     
    kojokroavi, Aug 24, 2012 IP
  17. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #17
    Well, there must be a link which displays the comment form when it is clicked, right? I cannot tell you which one is it because Icannot find it in the code and your theme is translated to Hebrew, but it must be there somewhere.
     
    Devtard, Aug 24, 2012 IP
  18. kojokroavi

    kojokroavi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18


    Could it be that this line <a href="#" onclick="toggle_visibility('foo');">Leave a comment!</a> Looked completely different in My website?.
     
    kojokroavi, Aug 25, 2012 IP
  19. kojokroavi

    kojokroavi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    In the single.php File I did not find the line you gave me, I did find This line:

    <div class="commentlink">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('No Comments', 'northern'), __('1 Comment', 'northern'), __('% Comments', 'northern'), '', __('Comments are closed.', 'northern') ); ?>
    </div>

    Perhaps this is the correct line?
     
    kojokroavi, Aug 26, 2012 IP
  20. Devtard

    Devtard Notable Member

    Messages:
    850
    Likes Received:
    133
    Best Answers:
    4
    Trophy Points:
    220
    #20
    Probably. Replace it with the link which uses the onlick action and you'll see whether it works or not.
     
    Devtard, Aug 26, 2012 IP