Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I use normal comments on BP pages?


  • YokoSix
    Participant

    @yokosix

    Hi! For our new project I have to remove all the activity streams and just use normal comments for member pages. So all logged in members can post comments on every other member page and their own. But it’s not working. I don’t need Ajax, I don’t need Likes, I don’t need mentions. I just need normal comments on BP pages. Is there any way to do this?

    Thanks

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

  • YokoSix
    Participant

    @yokosix

    I’m sorry to bug you again, but it just won’t show normal comments on our BuddyPress sites. Is it impossible – or is it too obvious and I’m kinda stupid? 🙂

    Thanks in advance!


    Henry Wright
    Moderator

    @henrywright

    Hi @yokosix

    comments_template() will work inside page.php or single.php

    Ref: https://codex.wordpress.org/Function_Reference/comments_template


    YokoSix
    Participant

    @yokosix

    Thanks, @henrywright! I tried this, but as soon as I send the comment, a blank wp-comments-post.php appears. But you’re saying comments_template() is also possible on BuddyPress-sites?


    Henry Wright
    Moderator

    @henrywright

    But you’re saying comments_template() is also possible on BuddyPress-sites?

    Yes definitely, but as far as I know, only inside singular contexts (i.e. page.php and single.php templates).

    Where were you pasting the function? And what does your comments.php file look like (that’s the file comments_template() uses)?


    YokoSix
    Participant

    @yokosix

    Thanks! I put the function into wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php. I tried several comments.phps from several themes, but the only thing that always shows up is the number of comments (0 comments), but no comment forms. I think that’s because comments are closed on this kind of page and I don’t know how to “open” them. And when I modify the comment forms to show up on closed comments, the blank wp-comments-post.php appears, after I click submit.

    Thanks again for your help!


    Hugo Ashmore
    Participant

    @hnla

    Define exactly what you call a member page, terminology is critical as what you’re asking doesn’t sound like it makes sense.

    You say remove activity streams, there are essentially two the main directory ‘activity’ and the view that seen in user accounts or as they are often referred to ‘profile screens’ the members personal area.

    You won’t be able to display comments in the BP screens as BP simply uses the WP pages as a placeholder, it replaces the normal content for it’s own, equally adding the comments template to the BP templates won’t work as those screens are not posts, have no post id to link comments to.


    YokoSix
    Participant

    @yokosix

    Thanks, @hnla! So you’re saying comments can only be shown on a page with an id? I just need the comments to be visible and functional on a member’s profile home page. Like on http://www.example.com/members/john/. But how does the comments function know, what id the member’s profile page has?


    Hugo Ashmore
    Participant

    @hnla

    It doesn’t WP comments are tied to the post or page against which they were made, the issue will be that you do not have multiple pages for members but url request which determines the data then pushes that out to the general page.php template , it’s probably possible to do but would require a fair bit of custom coding.


    YokoSix
    Participant

    @yokosix

    Okay, thanks! Is it possible to get comments not tied to a certain id but to an url?


    YokoSix
    Participant

    @yokosix

    Oh wait, that won’t work, because users can change their username on our site – which would also break the comments… Okay, now I’m officially lost…


    YokoSix
    Participant

    @yokosix

    Sorry for spamming! But is it somehow possible to give BuddyPress pages certain IDs, so the comments can use them?


    Hugo Ashmore
    Participant

    @hnla

    Not the pages, they don’t really exist as WP pages, BP just uses the file / physical template for it’s structure so when BP pushes it’s date out it sits within the theme in use. You would be needing to tie into the member ID, but that would only be the tip of the issues involved in running something like this up – there may be options or another approach to be found in some existing plugin? otherwise I think there’s quite a lot of fairly hard coding ahead.


    YokoSix
    Participant

    @yokosix

    Okay, thanks! I’ll try to figure it out – and if I find a somehow logical way to get it done, I’ll post it here.

    Thanks again!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How can I use normal comments on BP pages?’ is closed to new replies.
Skip to toolbar