Notifications
Clear all

wpForo 1.x.x [Solved] Can I load the LOGIN page by default if not logged in?

5 Posts
4 Users
4 Reactions
1,985 Views
Posts: 3
Topic starter
(@kwit)
Active Member
Joined: 8 years ago

I'd link to have a FORUM link on the top-right of my site. When clicked, if the user is not logged in, it should take them to the LOGIN tag but if logged in, it should just load the main forum categories tab.Β 

Is there a way to do this within the settings or do I need custom-code?

Thanks,

Β 

4 Replies
Robert
Posts: 10589
Admin
(@robert)
Support Team
Joined: 9 years ago

I'm sorry but I don't have solution for this. This is a custom development, there is no an easy way to do this.

BlackRaz
Posts: 406
Admin
(@blackraz)
Contributor
Joined: 8 years ago

Hi DearΒ KW Web & IT Consultant,

Thank you for using wpForo Forum
Please take a look at this
URL: Β  http://www.screencast.com/t/JyXKjViRtdV

Β 

Posts: 6
(@pepi1025)
Active Member
Joined: 8 years ago

Just write two new lines into index.php.

change this:

if($template == 'search'){
include( wpftpl('search.php') );

to this:

if ( !is_user_logged_in() ){
include( wpftpl('login.php') );
}elseif($template == 'search'){
include( wpftpl('search.php') );

Posts: 3
Topic starter
(@kwit)
Active Member
Joined: 8 years ago

@Robert - You gave up too easily πŸ™‚

@blackraz - Excellent solution and works easily. How did you come across thatΒ query solution?

@pepi1025 - Thanks, but I did no attempt to use your code based solution as blackraz's solution worked with just a url query edit

Β