Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom content after topic


  • jokke72
    Participant

    @jokke72

    Hi, for some reason the login does not work on bbpress topic page.

    I have this code in my functions.php file.

    add_action ('bbp_theme_after_reply_form_content' , 'bbp_goto_login_page' ) ;
    
    function bbp_goto_login_page() {
    echo '<p><a href="/login"><div class="gotologin">You must be logged in</div></a></p>' ;
    }

    This is working, but not the way I want. I would like it to only show if user is logged out and it should be visible on the topic page where there is normally the login form.

    Is there something like bbp_theme_after_topic_content?
    Tried googling, but could not find anything similar.

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

  • Robin W
    Moderator

    @robin-w

    only show if user is logged out

    function bbp_goto_login_page() {
    if (!is_user_logged_in ()) {
    echo '<p><a href="/login"><div class="gotologin">You must be logged in</div></a></p>' ;
    }
    }

    But you should be seeing the login automatically – what theme and other plugins are you using?


    jokke72
    Participant

    @jokke72

    As I mentioned, the BBPress login form is visible but not working. If I fill in my credentials it just takes me to the WordPress login page and I have to refill my credentials.

    My theme is Elementors Hello and I have a bunch of different plugins.


    Robin W
    Moderator

    @robin-w

    it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back

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