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?.
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!
Are you sure it can not hide , and only if someone wants to comment, then he press a button and comment?.
Do you want to display the comment form after clicking a button or just removing the phrase "Leave a Reply"? Please elaborate.
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
So if I understand correctly, you want to display the comment form only when someone clicks the link below each post. In that case, you need to edit files comments.php and single.php. Check this out: http://blog.movalog.com/a/javascript-toggle-visibility/
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.)
You can access them via your FTP client (wp-content/themes) or you can view them in the Theme Editor (WP Admin -> Appearance).
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( __( '« Older Comments', 'northern' ) ); ?> - <?php next_comments_link( __( 'Newer Comments »', '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: ', '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(); ?>
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.
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/
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.
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....
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.
Could it be that this line <a href="#" onclick="toggle_visibility('foo');">Leave a comment!</a> Looked completely different in My website?.
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?
Probably. Replace it with the link which uses the onlick action and you'll see whether it works or not.