Skip to:
Content
Pages
Categories
Search
Top
Bottom

Solved – Change location of template notices


  • Nick Coupland
    Participant

    @nickcoupland

    Hello,

    I am using the Nouveau theme but I am wondering how to change the position of template notices, for example, the message you get when saving your profile. I have done a couple of template over-rides to move the position of the profile picture and the notices are appearing directly below it (refer to the image). I thought the location of the notices would be controlled by an action but I cannot see how this happening from the templates code. Ideally I would like to move the notices above the profile tabs in the main column.
    Any help you be greatly appreciated.

    Screen-Shot-2019-08-06-at-9-59-37-am

    Thanks
    Nick

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

  • Boone Gorges
    Keymaster

    @boonebgorges

    The function responsible for creating the notices is bp_nouveau_template_notices(). For example, if you override the buddypress/members/single/profile/edit.php template, you can insert <?php bp_nouveau_template_notices(); ?> just above the tabs, and the notices will show there. (They’ll also show in the original spot, which you could hide with some targeted CSS.)

    To make a similar change without overriding the template, try the following:

    
    add_action( 'bp_before_profile_field_content', 'bp_nouveau_template_notices' );
    

    Nick Coupland
    Participant

    @nickcoupland

    Thank you so much. Worked a charm.


    N33D
    Participant

    @n33d

    Hi there,

    Is there are also a function to show the notices somewhere else for the legacy theme?

    Thanks in advance.
    Justin


    clickallco
    Participant

    @clickallco

    Should be this for legacy

    <?php do_action( 'template_notices' ); ?>

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