• 0
Sign in to follow this  
Followers 0

Login in icon bar that returns to same page

Question

Posted · Report post

For who is interested: Add in functions.php (platformbase)

// function name
		function add_icons_to_branding(){
			// This hook adds a stumbleupon icon to the header of your theme. The class referenced in the link can be seen in the style.css
			// and is the image from the CSS is placed in the images folder
			?>
			
			
			
			
			<?php if(!is_user_logged_in()) : ?>
				
				Log in ?†’
			<?php endif;?>
			<?php if(is_user_logged_in()) : ?>
				
				Swap User ?†’
			<?php endif;?>
		<?php }
		// end function[/code]

	
	Add in style.css
	
[code]/* @ CSS corresponding to the hook used in functions.php; adds a stumbleupon icon to branding section */ .icons .loginicon {background: url('../../icons/login.png') no-repeat 0 0;} .icons .loginicon:hover {background: url('../../icons/login.png') no-repeat 0 -22px;} .icons .loginswap {background: url('../../icons/login.png') no-repeat -22px 0;} .icons .loginswap:hover {background: url('../../icons/login.png') no-repeat -22px -22px;} .icons .e-golf4u {background: url('../../icons/e-golf4u.png') no-repeat 50% 0;} .icons .e-golf4u:hover {background: url('../../icons/e-golf4u.png') no-repeat 50% -22px;} .icons .prophet {background: url('../../icons/prophet.png') no-repeat 50% 0;} .icons .prophet:hover {background: url('../../icons/prophet.png') no-repeat 50% -22px;} .icons .contacticon {background: url('../../icons/contact.png') no-repeat 50% 0;} .icons .contacticon:hover {background: url('../../icons/contact.png') no-repeat 50% -22px;} .icons .forum {background: url('../../icons/forum.png') no-repeat 50% 0;} .icons .forum:hover {background: url('../../icons/forum.png') no-repeat 50% -22px;}

The login.png is a 44x44 pixel icon that holds 4 icon states. Have fun! PS Please replace the ***PLACEHOLDERS***

Share this post


Link to post
Share on other sites

1 answer to this question

  • 0

Posted · Report post

Revised version... add in style.css .icons .loginicon {background: url('../../icons/login.png') no-repeat 50% 0;} .icons .loginicon:hover {background: url('../../icons/login.png') no-repeat 50% -22px;} .icons .logout {background: url('../../icons/logout.png') no-repeat 50% 0;} .icons .logout:hover {background: url('../../icons/logout.png') no-repeat 50% -22px;} add in functions.php <?php if(!is_user_logged_in()) : ?> Login ?†’ <?php endif;?> <?php if(is_user_logged_in()) : ?> Logout ?†’ <?php endif;?> The login.png and logout.png are 22x44 pixel icons that hold 2 icon states

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0