Skip to main content

Logo Permalink

Shahjahan Jewel I have a suggestion on - Logo Permalink

Can we have a dynamic Logo Permalink for login/logout user?

User logged out: Redirect to - sitename.com

User logged in: Redirect to - sitname.com/portal

Gabriel Mathew

I need it too...

Create a code snippet in fluent snippet plugin

Bryan William

Gilbert Mutingu Jaddy, can you please help out with the snippet

Raiyan Marzan

Bryan WilliamΒ You can try with this snippet -
add_filter('fluent_community/header_vars', function ($vars) { if (empty($vars['auth'])) { $vars['logo_permalink'] = home_url('/'); } return $vars; });

Bryan William

Raiyan MarzanΒ Thanks very much, but I have 2 questions regarding this code.

  1. Should I replace the "home_url" with the URL I want to redirect to?
  2. Should I paste the code inside CSS or Javascript, as see in image below

Raiyan Marzan

Bryan WilliamΒ No, this is only for css and js. For custom code you can use this plugin https://wordpress.org/plugins/easy-code-manager/

Bryan William

Raiyan MarzanΒ Thanks, I added it to the fluent snippet.

But... Nothing happened.

Do I need to add the logout logo link to the code?

Raiyan Marzan

Bryan WilliamΒ It should work, I just tested it from my end. Please make sure you are checking as a logged-out user. If it still doesn't work, please create a support ticket they will help you get it working

Bryan William

Raiyan MarzanΒ Please let's reverse the code

User logged out: Redirect to -Β sitename.com/home

User logged in: Redirect to -Β sitname.com

Raiyan Marzan

Bryan WilliamΒ  add_filter('fluent_community/header_vars', function ($vars) { if (!is_user_logged_in()) { $vars['logo_permalink'] = home_url('/home'); } else { $vars['logo_permalink'] = home_url('/'); } return $vars; });

Bryan William

Raiyan MarzanΒ Thanks, it works