• Resolved Nicholas

    (@nerwin)


    I’m having troubles removing the comment link on the single post view. I want to remove it because it makes no sense as the comments are literally right under it. It looks way out of place.

    But since the theme author used single.php for both the index and single post..its making it really difficult to achieve.

    Here is a link to postbin of Suits’ single.php: https://pastebin.com/TKQ1iyAG

    I’m not sure what to do. Hopefully someone can figure this out!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey Nicholas,

    How are you doing today?

    Since you’re looking to remove specific link I think this would be easier to do with custom CSS rather then editing theme core files.

    With this being said please post link to your site where I can see this link and I’ll help with some CSS to remove it.

    Cheers,
    Bojan

    Thread Starter Nicholas

    (@nerwin)

    Hello!

    I think I might have fixed it.

    I changed

    <?php if ( comments_open() ) : ?>

    to

    <?php if ( comments_open() && ! is_singular() ) : ?>

    which appears to have remove the the comment link on the single post view and kept the comment link on the homepage.

    I don’t know if there is a better way of doing it…but I think this Suits theme is a child theme of Twenty Twelve. I’m not sure there..the code seems remarkably similar. So I found a modified code that was shared on here that fixed the same problem and implemented some of it in mine which seemed to have worked.

    Hey Nicholas,

    This can definitely work too, it’s just more complex solution. CSS allows us to target single post pages as well and it would be easier to add it which is why I suggested it.

    Glad you managed to figure that out ??

    Cheers,
    Bojan

    Thread Starter Nicholas

    (@nerwin)

    I just have to remember not to update the theme if the author releases a update, haha. But I have backups if I did by accident.

    Hey Nicholas,

    Hmm I honestly never understood child themes that are being updated by theme authors.

    If you comment that part of the code and link me the page where I can see this link we can still try to do it with CSS so you can add the code using plugins such as https://www.ads-software.com/plugins/simple-custom-css and have changes safe after theme update.

    Let me know if you want to do this.

    Cheers,
    Bojan

    Thread Starter Nicholas

    (@nerwin)

    The problem is that all the changes are made are not just CSS, I’ve changed a bit of the php code as well.

    Alright ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Remove comment link on single post’ is closed to new replies.