Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to disable the comment form on forums topic page?

  • I have installed bbPress as plugin to WordPress – everything works fine but when I am accessing a topic page the comment form is still visible. However this is not the case when displaying the forum page.

    Does anyone know how to disable the comment form on forums topic page?

Viewing 16 replies - 1 through 16 (of 16 total)

  • pimarts
    Participant

    @pimarts

    You mean the reply form to actually reply to a topic? That seems like normal behaviour to me?

    You could display:none it in CSS to hide it, but I can’t see the point to be honest. I’m probably not understanding you properly.

    Oh wait, you mean you’ve got two textarea’s? One for comments and one for replying to a topic?

    Sounds like a problem in your theme?


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    @vladoa – It sounds like the theme you’re using is conflicting with the way that bbPress is trying to prevent the comments form from appearing. Curious what theme you’ve got?

    It was very strange – I couldn’t figure it out so I wrote an if statement which checks whether the word “forum” is found in the URL. So if it is, it hides the comment form.

    Silly solution, but it works.

    My theme is Guangzhou.

    Hay i also have the same problem can you please tell me about the statement you have used to hide comment form. i an not familiar with php

    in my case I went to page.php template and replaced this

    comments_template();

    with this

    if (!stristr($_SERVER['REQUEST_URI'],'/forums/')) { comments_template(); }

    where forums is my forums base


    jmatthewgore
    Participant

    @jmatthewgore

    Thanks, rvencu! I’m using the Suffusion theme and have been having the same problem. I’ll try your fix and see if it does the trick for me.

    - Matthew


    jmatthewgore
    Participant

    @jmatthewgore

    Hmm… No, when I make this change, I get an “unexpected T_STRING” error. Maybe there’s a missing semi-colon or something? I’m not good enough with PHP to be sure.

    actually you need to replace exactly the whole string (including semicolon) with the second one (no semicolon at the end)

    also make sure that you do not mix ” with ‘ anywhere

    it is not that complicated to fix it. if you can’t just paste the code here including the surrounding lines so I can see it.


    jmatthewgore
    Participant

    @jmatthewgore

    Just so we’re clear, this is what I’m doing in the page.php code. I change this:

    <?php

    suffusion_before_end_post();

    comments_template();

    ?>

    to this:

    <?php

    suffusion_before_end_post();

    if (!stristr($_SERVER,’/lm-forums/’)) { comments_template(); }

    ?>


    jmatthewgore
    Participant

    @jmatthewgore

    Incidentally, the php error message I get says that there’s an unexpected T_STRING on Line 1, though I have changed nothing but the lines indicated above. Notepad++ calls them lines 73-79.

    maybe you have an issue with the CR if you have a linux host maybe you need to go to Edit -> EOL Conversion and check the UNIX format for line end.

    otherwise it may appear for linux that all text is on line 1, hence the error


    jmatthewgore
    Participant

    @jmatthewgore

    Thanks again, rvencu :)

    I do have a Linux host… a CentOS based VPS (managed). Beyond that, I’m afraid that your suggestion is Greek to me. I don’t really know anything about editing the EOL Conversion (or what it is).

    However, I can safely say that I’ve experienced my fair share of php errors on this server, and previous ones have not been listed as “line 1″. Also, aside from this comment form showing up, my whole install of wordpress and buddypress/bbPress works just fine, so I’m not sure I understand why changing this line would be a particular problem anyway… maybe it’s just a syntax error?

    But are you saying that you don’t see any obvious problem with the code I pasted above?

    Many Thanks,

    Matthew

    I just tell you to look at that menu on Notepad++. you should choose Unix format, then save the file and upload it again on the server. this should fix your problem in my opinion

    EOL is end of line. Different OS uses different codes for EOL, we have Windows format, Mac format and Unix format. often is possible that is you save the text file with windows format it will look nice under windows os but may appear as a single long line for linux.

    notepad++ can help with that and correct your problem. you introduced the problem as soon as you edited the file and saved it with windows EOL


    jmatthewgore
    Participant

    @jmatthewgore

    Ohhhhh… lol. I see what you mean :) Perhaps I’m not quite as awake this morning as I thought. Thanks again! I’ll check.

    - Matt


    jmatthewgore
    Participant

    @jmatthewgore

    Yep, that was it. Somehow, it was set to Mac (I’m on Windows), but making the change fixed everything. Just built this computer a week ago… I had forgotten that this was a new install of notepad++

    Thanks once again!

    - Matt

    Closing since this is an old topic. If you encounter this issue feel free to create a new topic :)

Viewing 16 replies - 1 through 16 (of 16 total)

You must be logged in to reply to this topic.