Skip to:
Content
Pages
Categories
Search
Top
Bottom

Site Notices body text to be aligned left and able to have paragraphs


  • Kristian Yngve
    Participant

    @kristianngve

    WP Version: WordPress 5.1.1
    BP Version: Version 4.2.0

    Relates to Site notices found in Users, Site Notices:

    How to have the message text entered left while keeping the topic title centered.

    and also to be able to breakline to make another paragraph where one is made.

    -> At the moment, all the body text gets clumped together and centered.

    I believe from experience that it’s something that needs to go in my functions?

    Thank you for anyones advice!

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

  • Venutius
    Moderator

    @venutius

    Hi there,

    To centre the title you can use the following css slector:

    #sitewide-notice strong {
        text-align: center;
    }

    However currently it’s not possible to separate the two paragraphs. This is due to the text going through the wp_filter_kses() function which is removing the <p> tags from the text thus turning two paragraghs into a single paragraph.

    You could ask for an enhancement in Trac, to change this to an alternative function bp_messages_filter_kses() this would allow you to add a filter to allow <p> in the sitewide notice content. If you raise the ticket I’ll add this information as a suggestion to the devs.


    Kristian Yngve
    Participant

    @kristianngve

    Venutius, hi.

    So I tried that (as to align it left as it’s actually stuck on center position), but sadly it doesn’t work at all.

    I tried many variations too: for example #bp-sitewide-notice strong
    Thank you as always, but on getting this CSS right, any other ideas, my friend?


    Venutius
    Moderator

    @venutius

    Both should be displayed on the left, if they are being centered then I think you have something that is affecting the CSS for these already. Do they still center with a default theme such as 2017 loaded?


    Kristian Yngve
    Participant

    @kristianngve

    Ahh! I think I know what it is, but it’s not the theme – tried 2019 and as ugly as it displays, still stuck in center.

    Okay, let me tell you, it’s the widget I’m using to place it in a certain place on a page (amr shortcode any widget). The shortcode is: [do_widget id=bp_messages_sitewide_notices_widget-2]

    So, i used your CSS and tinkered it a little:

    #bp_messages_sitewide_notices_widget-2 strong {
        text-align: left !important;
    }

    But, believe it or not, the title (the part i wanted to keep center) is the only thing that goes left, body text still center. – getting so close!, But how to switch that?


    Venutius
    Moderator

    @venutius

    On my system the widget has both the title and the message alligned left.

    did you try:

    #bp-sitewide-message p {
    text-align: left;
    }

    That should align both the title and the message left, you’d then need the strong css code to align the title center again. That’s if it works.


    Kristian Yngve
    Participant

    @kristianngve

    Ah the p…

    couldn’t get yours to work for some mad reason, but after adding your p idea to my crazy idea, I ended up with:

    #bp_messages_sitewide_notices_widget-2 p, strong {
        text-align: left !important;
    } 

    Can’t believe it, but it WORKED!

    Definitely couldn’t of done that without you. you even beat Google after I pumped “bp-sitewide-message” all over the internet.

    Anyway, we got there, so deep thanks for it 🙂


    Kristian Yngve
    Participant

    @kristianngve

    Oh! about the other thing:

    So, I’ll raise a ticket for you to add the information as a suggestion to the devs.

    Where do i post this said ticket? or do I just post it as a separate question (like I did this one) but with the correct category and tags?


    Venutius
    Moderator

    @venutius

    Just click on the link to Trac above and select new ticket


    Kristian Yngve
    Participant

    @kristianngve

    Ah, thanks…

    Okay, all done. Trac ticket is: #8079


    Kristian Yngve
    Participant

    @kristianngve

    And thank you again for helping me out with the ticket thing. 😉

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