Move Login Fields into Buddybar (Adminbar)
-
Inactive
Hello, on my installation (and by default) you have the buddybar (adminbar) at the top, and then the search-login-bar just below it.
For my search-login-bar I removed the actual search feature and all I have left in there is the login fields.
For my buddbar/adminbar, I removed the Visit> dropdown, so there’s nothing on the right side whether somebody’s logged in or out.
What I would like to do is place the login fields (or when you’re logged in the mini avatar and username / logout) into the buddybar/adminbar on the right-hand side of the page.
Is this possible to do? I noticed in the search-login-bar, the call for it is a simple php line. However, just putting that into the bp-core-adminbar causes an error. I may just be doing it the wrong way.
Can anybody tell me how I can properly do this? Thanks in advance.
-
@Jrtlm
Here’s the code I put in bp-custom.php (if you don’t have a bp-custom.php file already, create it and put it in the plugins directory)
The code:
<?php
function my_login_bar(){
?>
<div id="search-login-bar">
<?php bp_login_bar() ?>
</div>
<?php
}
add_action( 'bp_adminbar_menus', 'my_login_bar', 100 ); ?>Also, if the CSS for the search/login bar isn’t in your bp-core/css directory, you may want to copy it from your bphome theme (not all of the css, just the part that relates to the search-login bar).
Also, the number 70 you see above determines the location of the menu item on the adminbar. The random menu on the far right is 100. I got rid of that random menu and that’s why I used 100 in my code.
Hope this helps. You’ll probably need to tinker around with it to get your location just, so, but it’s a start.
All the best to you!
InactiveThanks for the answer. It works exactly like I intended in FF, Chrome, and Safari. In IE, not so much. The User/Password fields and Login / SignUp buttons hang slightly off the page to the right (creating a horizontal scroll bar), but when I hover over the pre-existing signup link on the left side of the adminbar, the login jumps back to the left where it’s supposed to go.
Here’s the CSS code I have:
#search-login-bar2 {
position: absolute;
top: 3px;
left: 500px;
width: 501px;
border: 0;
padding: 0;
margin: 0;
text-align: right;
}
#search-login-bar2 #login-form, #logout-link {
float: right;
width: 500px;
}
#logout-link img {
vertical-align: middle;
}
(I changed the class to add the 2 on the end so it wouldn’t conflict with the base.css)
@jfcarter, I see you tooling around the forums with your sleeves rolled up answering questions. Way to go!
Thanks. Just trying to be helpful. You guys sure helped me!!!
InactiveSorry, I guess I should’ve used the code tag.
#search-login-bar2 {
position: absolute;
top: 3px;
left: 500px;
width: 501px;
border: 0;
padding: 0;
margin: 0;
text-align: right;
}
#search-login-bar2 #login-form, #logout-link {
float: right;
width: 500px;
}
#logout-link img {
vertical-align: middle;
}
Jrtlm-
It seems that this issue is resolved. Please set the light up top to green and we’re good to go!
InactiveThe issue is resolved for three browsers, but that only encompasses less than 40% of the Internet. So at best I’d say it’s 40% resolved.
The question of getting the login field into the buddybar/adminbar has not been answered for IE.
Jrtlm-
The issue is resolved for three browsers, but that only encompasses less than 40% of the Internet.
You may be giving Internet Explorer way too much credit. Check the recent stats for yourself. At this one source, IE represents only about 42% of browser usage. So, your question may be almost 60% resolved!
Of course, there are a few other sources that state overall IE to be about 66% or so. However, there are ways that browser usage data can be overestimated as well as underestimated. I like to say that IE realistically has a market share of 50 to 55%, but that its share is slowly declining each month.
A few questions for you:
Which versions of IE?
Does it not work on any of them, or just not on the oldest version?
InactiveI’m sorry, I mistyped. I should have said 60% of my traffic, not the Internet.
The versions of IE where it is misaligned is 8.0, 7.0, 6.0, and 5.5. Basically all of them. This was verified using browsershots.org
I’m sorry, I mistyped. I should have said 60% of my traffic, not the Internet.
The versions of IE where it is misaligned is 8.0, 7.0, 6.0, and 5.5. Basically all of them.
Have you looked in the members theme in the /css/ie/ directory? Also, does your custom member theme have links to the IE style sheets in your header.php file?
I saw a joke on Twitter the other day. To parapharse: the universe was created in one day. It took the other 5 to get it to work on Internet Explorer. Thanks, Trent!
Getting themes of any platform (not just WordPress) to work in all versions of IE can be frustrating and tricky at best, impossible at worst. I would focus on optimizing your users’ IE experience on IE8 and IE7. Some designers are not even supporting IE6 anymore. I wouldn’t even worry about IE5.5 Of course, this is only my opinion.
- The topic ‘Move Login Fields into Buddybar (Adminbar)’ is closed to new replies.