Support Forum

Change Login Button Behavior

JH Jerry Hilburn
Jerry Hilburn
Member

I would like the login button to go immediately to the wp-login.php page instead of the dropdown login on Unified Theme.

Please advise.

8 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

i believe this is what you also sent a PM about which I have just answered

JH Jerry Hilburn
Jerry Hilburn
Member

From your PM: 

No – Unified does not separate desktop from mobile. There is just the spHead.php template in the /templates folder.

Both Desktop and Mobile are dealt with inside the same template using conditional statements so you will need to look for the function twice abd you will see above if it is for $spDevice == ‘mobile’ or not.

>>>>>>>> Totally confused

Please provide code sample and location in spHead. I am sorry but I don’t understand your code reference.

MP Mr Papa
Mr Papa
Member

afraid I am not privvy to all this discussion.. @yellow-swordfish will be back tomorrow and can report back…

YS Yellow Swordfish
Yellow Swordfish
Member

Let’s put it a different way.

You have the code changes that you want to make (they were in your PM). In the Unified theme you will need to make them twice in the same template. The template is /template/spHead.php. Search for the function to change – just find both occurrences.

By the way,  I am unsure where you got the code from but I assume it was another topic thread. Remember that it is best to create a child theme if you plan to change the SP theme code in any way – to save having it overwritten during a future update. Child themes are quick and easy and you can download the framework from our store (no cost). 

For full details – and it really is easier than it looks – see https://simple-press.com/documentation/codex/themes/theme-basics/creating-a-child-theme/

JH Jerry Hilburn
Jerry Hilburn
Member

Ok I tried it and it does not work. Apparently I am doing something wrong. I only see references for mobile start in my file and cannot identify the correct lines of code to modify. I apologize for not being able to do this on my own, but I need your help. 

Can we clear the slate, forget the PM, forget everything written above, and start over?

I am using the Unified Theme. I have created a child theme. I am ready to modify the spHead.php file.

I believe I need to add this snippet of code somewhere in this file.

&loginLink=http://forums.boyce-astro.org/wp-login

My objective is to redirect all login buttons on the forum page to open this page in my website:

http://forums.boyce-astro.org/wp-login

Which lines of code do I modify in the spHead.php file to achieve this goal.

Can you identify the line number and provide a before / after code snippet showing the line of code prior to modification, and after modification.

I have attached a copy of the spHead.php file as spHead.txt for reference purposes.

Please advise.

Thank you.

YS Yellow Swordfish
Yellow Swordfish
Member

Let’s do it one at a time starting with desktop version. And just in case you do not know you MUST use a plain text editor for the editing. NOT a Word Processing package.

Open the spHead.php file in the /templates folder of your child Unified theme. Find Line 182 that looks like this:

sp_LogInOutButton('tagClass=spButton spRight', __sp('Log In'), __sp('Log Out'), __sp('Log in and log out'));

and change it to be:

sp_LogInOutButton('tagClass=spButton spRight&logInLink=http://forums.boyce-astro.org/wp-login.php', __sp('Log In'), __sp('Log Out'), __sp('Log in and log out'));

(There were two errors in the code you pasted above. One was capitalisation of the ‘I’ in ‘logInLink’ and the other was the lack of ‘.php’ on the end of the login page url).

Now find line 200 that looks like this:

sp_LoginForm($loginForm);

and comment it out. In other words place a # character in front of the line:

#sp_LoginForm($loginForm);

and that should be is – assuming your domain IS ‘http://forums.boyce-astro.org’.