WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Twelve
[resolved] How to delete "leave replay" from single post? (34 posts)

  1. webula
    Member
    Posted 1 year ago #

    Deleting this code from single.php

    <?php
    					// If comments are open or we have at least one comment, load up the comment template
    					if ( comments_open() || '0' != get_comments_number() )
    						comments_template( '', true );
    				?>

    or substitution "false" instead of "true" does nothing.

    Any ideas?

    http://wordpress.org/extend/themes/twentytwelve/

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Have you a Child Theme?

  3. webula
    Member
    Posted 1 year ago #

    No, I haven`t

  4. I've not looked at Twenty Twelve (yet!) but modifying that file in Twenty Twelve will cause you pain later on. Best to avoid that.

    Don't modify any Twenty Twelve file (or any theme file you download here for that matter). Instead create a child theme and make your changes in the child theme directory.

    That way when you get an update for that theme you do not lose your changes.

    http://codex.wordpress.org/Child_Themes

  5. webula
    Member
    Posted 1 year ago #

    I know and understand the importance of child themes, but it doesnt help me to solve the problem above. So I`m still looking for code hack to remove "leave replay" in single post.
    I do not understand the usability of this inscription in single post, because the form of comments so there is yet...

  6. alchymyth
    Forum Moderator
    Posted 1 year ago #

    this is generally not theme specific:

    have you exhausted all dashboard methods to 'un-allow' comments:

    dashboard - settings - discussion ?

    dashboard - posts - all posts - quickedit below the post title - untick 'allow comments' ?

    if you have still comments or 'leave a reply' showing after using the options, please post a link to your post.

  7. webula
    Member
    Posted 1 year ago #

    @alchymyth

    I do need comments on my blog. I want to delete only note "leave reply" in single post. Could you read my first post more closer?

  8. alchymyth
    Forum Moderator
    Posted 1 year ago #

    I want to delete only note "leave reply" in single post.

    yes, you can do this with the dashboard options for selected single posts.

    I checked this with Twenty Twelve, and there is no trace of 'Leave a Reply' left in a single post if the comments are 'un-allowed'.

    particular deleting your mentioned section from single.php of Twenty Twelve will not leave any output.

    I do need comments on my blog

    this is a direct contradition of your attempt to remove the comments code from single.php;
    'blog' equals 'posts' and the commenting is usually done via the single post.

    if your sitution is different, please post a link to your site to illustrate your problem, and to allow somebody to start investigating.

  9. alchymyth
    Forum Moderator
    Posted 1 year ago #

    ps: if it is just about the wording 'Leave a Reply', have a look at http://wordpress.org/support/topic/how-to-change-wording-of-leave-a-reply?replies=39#post-1681116

    this would be in comments.php of your theme ... which brings us back to the topic of creating a child theme to make the edit with...

  10. webula
    Member
    Posted 1 year ago #

    @alchymyth again.

    Apparently we speak different languages i see.

    1. I want just to delete the wording 'Leave a Reply' only in single posts.
    2. I really need comments allowed in all of my posts.
    3. Child theme or Twentytwelve itself..what difference if i can`t see here example for code DELETING the wording 'Leave a Reply', not editing in other words, just deleting it.

    I dont understand why i need wording 'Leave a Reply' in my single post when i have commenting form already below?
    my post example: http://dmikarpenko.com/pochta-rossii-cherez-dva-goda/

  11. alchymyth
    Forum Moderator
    Posted 1 year ago #

    1. I want just to delete the wording 'Leave a Reply' only in single posts.

    I got it - see my last reply.

    edit comments.php of your theme, near the bottom, change:

    <?php comment_form(); ?>

    to:

    <?php comment_form(array('title_reply' => "")); ?>

    if you need, you can remove the link to your site, if you edit your reply within 30 minutes after posting.

  12. webula
    Member
    Posted 1 year ago #

    Thanks, but your variant not working....
    still have the wording 'Leave a Reply'

  13. Hi webula,

    did you ever try to look up 'Leave a reply' in the Theme, find out where it is set and delete it there?

    Maybe this will work:

    1. Create a Child Theme (if you didn't already).
    2. Create a content.php file and copy the code from Twenty Twelve's content.php file.
    3. On line 28, play with the first parameter of the comments_popup_link() function, an empty string will probably do.
  14. webula
    Member
    Posted 1 year ago #

    @Konstantin Obenland

    Tried it already. Changing content.php changes comments_popup_link on main page too, but I need it.

    Well.. had to return to clean Twenty Ten theme.

    Thanks all for helping.

  15. mindctrl
    Member
    Posted 1 year ago #

    If I understand you correctly, you only want to remove that message on the single posts view. If so, you can do something like this in your child theme's content.php.

    <?php if ( !is_single() ) comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>

    That should leave it alone on the main index page, but not show it on single view.

  16. webula
    Member
    Posted 1 year ago #

    Nope. Doesn`t working too. I think TwentyTwelve Theme is Special Magic.

  17. alchymyth
    Forum Moderator
    Posted 1 year ago #

    i still disagree with:

    but your variant not working....

    the change to comments.php should be working and worked in my test site with Twenty Twelve.

    there might be a last chance with with css:

    .single #reply-title { display: none; }

    add this to style.css (ideally, but not necessarily, in a child theme) of Twenty Twelve.

  18. mindctrl
    Member
    Posted 1 year ago #

    Are you using pages or posts? Try this in your child theme content.php

    <?php
    if ( ! is_singular() {
      comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) );
    }

    That should work. If not, are you sure you're using Twenty Twelve? :D

  19. alchymyth
    Forum Moderator
    Posted 1 year ago #

    @mindctrl1 - good point ;-)

    I missed that smaller 'leave a reply' near the top of the post, and was focussing on the larger one just above the comment form ;-(

    for a css fix, that would be:

    .single .entry-header .comments-link { display: none; }
  20. webula
    Member
    Posted 1 year ago #

    to alchymyth

    even power css doesn`t work - http://dl.dropbox.com/u/12452793/css.JPG

  21. alchymyth
    Forum Moderator
    Posted 1 year ago #

    just edited my last reply - I was looking at the 'wrong' text ;-(

  22. webula
    Member
    Posted 1 year ago #

    Okey. Lets tell you.
    I dont want to create child theme, because i did some corrections in TwentyTwelve files(such as data formatting and social buttons). I know thats wrong and so-so and all of us must use child themes for editing.

    By the way could you help me and paste there required code for content.php or single.php to decide my so global trouble? For exaple on pastebin.org or somewhere else if the code for file very big for answer there.

    Wil be very appreciated, really.

    P.S
    Both variants (with css and last note from member mindctrl) doesn`t working for me.

  23. mindctrl
    Member
    Posted 1 year ago #

    It looks like I was missing an ending ) in my previous comment, which I can no longer edit to correct.

    Post a screenshot highlighting exactly what you mean. There's a bit of a language barrier here I think, and a screenshot with the area circled would help.

  24. webula
    Member
    Posted 1 year ago #

    to mindctrl
    thats your last comment
    "<?php
    if ( ! is_singular() {
    comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) );
    }"
    it doesn`t working for me.

    i want very simple thing: delete note "leave reply" under the single post.
    screen http://dl.dropbox.com/u/12452793/single%202.JPG

  25. mindctrl
    Member
    Posted 1 year ago #

    Replace your content.php with this one.

  26. webula
    Member
    Posted 1 year ago #

    to mindctrl

    Thanks). It`s everything ok at last.

  27. mindctrl
    Member
    Posted 1 year ago #

    Glad to hear it. Can you mark this thread resolved?

  28. webula
    Member
    Posted 1 year ago #

    yes. sure.

  29. rocketman7k
    Member
    Posted 1 year ago #

    @alchymyth
    Great advice!

    edit comments.php of your theme, near the bottom, change:
    <?php comment_form(); ?>
    to:
    <?php comment_form(array('title_reply' => "")); ?>

    This worked for me perfectly in my child theme.

  30. alaburb
    Member
    Posted 1 year ago #

    Success via @Konstantin Obenland:

    To remove 'Leave a reply' from the main page of the Twenty Twelve theme, remove the following code from content.php

    <div class="comments-link">
    	<!--<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
    </div><!-- .comments-link -->

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic