Skip to:
Content
Pages
Categories
Search
Top
Bottom

404 after logout from private forum


  • Jairo Ochoa
    Participant

    @jairoochoa

    Hi,

    Whenever I logout, using bbpress conections widget, if I’m inside a private forum I get a 404 page.
    But I’m at any other page or post or even in a public forum everything goes OK.

    If at least I could set on the widget a logout url, I will send the user to the home.

    Regards,

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

  • Schpil
    Participant

    @schpil

    I have exactly the same problem!
    Could someone please help???
    Thanks!!


    Robin W
    Moderator

    @robin-w

    yes, drop this into your functions file.

    Functions files and child themes – explained !

    This will send users to the /forums/ page whenever they log out -whether private or public forum or on a topic or reply, or anywhere within bbpress. If you logout, you’re saying your done, so taking you back to the index seems a logical place to end up !

    You can change the $url to say ‘/home/’ if you want the home page,

    //sends the user to $url - in this case '/forums/'  
    function rw_logout ($redirect_to) {
    	$url='/forums/' ;
    	$redirect_to = '<a href="' . wp_logout_url( $url ) . '" class="button logout-link">' . esc_html__( 'Log Out', 'bbpress' ) . '</a>' ;
    	return $redirect_to ;
    	}
    	
    	add_filter ('bbp_get_logout_link', 'rw_logout') ;
    	

    Schpil
    Participant

    @schpil

    Hi!

    Is this the file? : bbpress-functions.php
    Is this its location? : /public/www/wp-content/plugins/bbpress/templates/default

    Where exactly do I drop the lines into the file?

    thanks for your help!


    Robin W
    Moderator

    @robin-w

    no the file is one that belongs to your theme called just functions.php

    you’ll find it at

    wp-content/themes/%yourthemename%/functions.php

    where %yourthemename% is the name of your theme.

    If you don’t have a child theme, then you should create one, see

    Functions files and child themes – explained !


    Schpil
    Participant

    @schpil

    It works great, thanks! You’ve been very helpful!!!


    Robin W
    Moderator

    @robin-w

    great – glad you’re fixed !

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