Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbp_reply_content() adds 'DIV' tag. need to remove.


  • vetto
    Participant

    @vetto

    WP 3.6.1
    BBP 2.4
    (buddypress 1.8.1 if that’s relevant)

    I am trying to style my loop-single-reply template.
    I am working on a copy placed in my wp_theme/bbpress directory…it is a copy of the default.

    The problem is in the bbp reply DIV (that contains the author div and the content div). I need to get the content function to stop automatically adding “div” tags around the content (I want to use span tags).

    I have tried to follow the rabbit trail through the files to figure out where these DIV tags are getting added, and the best I can figure is that there is a filter putting them in there.

    I only need the actual content and so I have commented out the filter applied in includes/replies/template.php around line 525, and simple replaced it with return $content

    That worked, but now bbcode is not working. Is there a way to stop this behavior without altering the bbpress plugin files (which will get destroyed during an upgrade)?

    My forum is private, but I can set a public test one up if that will help…

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

  • vetto
    Participant

    @vetto

    set up a test forum so you can see the result of my messing around with the /includes/replies/template file

    Ignore the aesthetics, gotta get the structure right before I can finish the design.
    http://themainbrace.com/forums/forum/we-are-motorcycles/test/


    Kaliceos
    Participant

    @kaliceos

    I don’t have any extra div in my content inside <div class="bbp-reply-content"> with normal filters.

    The divs are not added by the bbp_reply_content, they are in the template file. The way you changed the template file, there’s no more div between author and content.

    I think what may cause your issue are the paragraphs that are block elements. They are added by a filter but a lot of filters are used on bbp_reply_content and a lot of them are useful, you shouldn’t take all of them off. You can disable the one that adds the paragraphs by using this code in your functions.php :
    remove_filter('bbp_get_reply_content','wpautop',40);

    But keep in mind that you will not have any paragraph in your replies. You may want to make your own filter to edit only the first paragraph. Search the codex for the add_filter function and php doc for the preg_replace function.


    vetto
    Participant

    @vetto

    I made the author and content one larger div in my single-loop-reply template. I wanted to span the author name/link and the content into one paragraph but was stymied by the added div id “d4p-bbp-quote-222” now that I paste that, it looks like a plugin added that. Isn’t that typically what the “d4p-….” is in the id/class name? a plugin?

    So to answer the question, you are saying that there is nothing in the bbpress code itself that adds a “div” tag to the author or reply sections? If that is true, then I am off and running.


    Kaliceos
    Participant

    @kaliceos

    In my test install with default theme, I don’t see any div in replies, only paragraphs. So I guess it’s true 😉

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar