WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Delete "Leave a Reply" | "Comments" et. al. (17 posts)

  1. scooter339
    Member
    Posted 1 year ago #

    This question must have been asked hundreds of times. I have looked and can't get the same answer.

    How can I get rid of Leave a Reply and comments.

    I would rather go after them in a php file.

    Thanks.

  2. graphical_force
    Member
    Posted 1 year ago #

    This depends on the theme you are using. Could you post a link to your site and let us know what theme you are using?

  3. verkko
    Member
    Posted 1 year ago #

    Log in to you dashboard and go to Settings > Discussion

    Un-tick Allow people to post comments on new articles

    Un-tick Enable threaded (nested) comments

    You can also control the comment on individual page / posts by un-ticking the comments box. If you can see the comments box on the individual post edit pages, you can reveal it by going to the top right hand corner of the screen and clicking on the screen options drop down. Tick the Comments and discussions checkboxes and you will be able to control what you show on a page by page basis too.

  4. scooter339
    Member
    Posted 1 year ago #

    I think the issue might be that I am building a child theme on top of 2012. The site is http://cottonwood.co.

    I was able to get rid of "reply" before by doing what you suggested. In fact, I deselected everything I could on the discussions page.

  5. graphical_force
    Member
    Posted 1 year ago #

    So were you able to turn them off? I still see Leave a Reply?

  6. scooter339
    Member
    Posted 1 year ago #

  7. graphical_force
    Member
    Posted 1 year ago #

    The code you are looking for is in your comments.php section. You can manipulate that to not show comments.

  8. graphfx21
    Member
    Posted 1 year ago #

    You should be able to just remove the get_comments() tag, that grabs the comments template. Not sure where that is in the 2012 theme, probably in single.php or content-single.php.

  9. scooter339
    Member
    Posted 1 year ago #

    Thanks GF. I'm just starting on php and I'm wondering where in this code I should place "//"

    ?>
    
    	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<header class="entry-header">
    			<h1 class="entry-title"><?php the_title(); ?></h1>
    		</header>
    
    		<div class="entry-content">
    			<?php the_content(); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<footer class="entry-meta">
    			<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
    		</footer><!-- .entry-meta -->
    	</article><!-- #post -->

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

  10. graphical_force
    Member
    Posted 1 year ago #

    If it is a child theme, just copy the file into your child theme and delete the code.

  11. scooter339
    Member
    Posted 1 year ago #

    Well, that was just too simple for me. It's logical and a great help.

  12. graphical_force
    Member
    Posted 1 year ago #

    Great! :)

  13. scooter339
    Member
    Posted 1 year ago #

    I spoke too soon. I removed the code:

    http://screencast.com/t/TE9U00Av

    Updated, but I still see reply on each page: http://cottonwood.co

  14. graphical_force
    Member
    Posted 1 year ago #

    I just did a test and I removed the code in there on the same theme and it worked. That controls the comment code so without it, you should not be showing the reply. Is that in your child theme?

  15. scooter339
    Member
    Posted 1 year ago #

    I'll look in the child theme.

    I'm getting a bit worried:

    Turns out, I removed the code form the content.php page. I restored it an no difference to the following:

    http://cottonwood.co

    Home page displays content but also reply
    All other pages including sample page no longer display con ten but the reply form is gone.

    The contact page displays the the form but also the reply form.

  16. graphical_force
    Member
    Posted 1 year ago #

    Maybe you can try to flush your browser cache to see if you see the changes again but this is a lesson in making backups as well. These things happen and you have to have a way to restore if something gets screwed up. There are many methods of backing up and that should become part of your work flow in the future. Good luck.

  17. scooter339
    Member
    Posted 1 year ago #

    I thought I could back up on my HD and let the DB bee. That turned out all wrong. So now I have BackupWordPress. I don't get how it works, and I hope I've picked a good plugin. The other two back up drop box and cloud flare seemed cryptic.

    Anyway, if I save wp-content and wp-config, do you think I can restore the site? I have all the plugins and themes offline including the child theme.

    Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic