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
I need it too...
Create a code snippet in fluent snippet plugin
Gilbert Mutingu Jaddy, can you please help out with the snippet
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; });
Raiyan MarzanΒ Thanks very much, but I have 2 questions regarding this code.
- Should I replace the "home_url" with the URL I want to redirect to?
- Should I paste the code inside CSS or Javascript, as see in image below
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/
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?
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
Raiyan MarzanΒ Please let's reverse the code
User logged out: Redirect to -Β sitename.com/home
User logged in: Redirect to -Β sitname.com
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; });
Raiyan MarzanΒ Thanks, it works