Archived

This topic is now archived and is closed to further replies.

  • 0

Resolved How To Make Social Icons "Portable"


Question

Posted · Report post

Not sure if this is appropriate or not, but I thought it might be useful to some members so I'm sharing it here.

The default social icons that come with the PageLines branding section look and "feel" (on hover) great. The only thing I wasn't crazy about was that I didn't want them in the header. I wanted them in the footer.

So I did a little bit of fiddling around and managed to find a way to make them somewhat portable and, at the same time, retain the nice hover behaviour.


<section class="section-branding"><div class="texture"><div class="content"><div class="content-pad"><div class="branding_wrap fix"><div class="icons" style="bottom: 12px; right: 1px;"><a target="_blank" href="http://YOURURL.com/feed/" class="rsslink"><img src="http://YOURURL.com/wp-content/themes/pagelines/sections/branding/rss.png" alt="RSS"/></a><a target="_blank" href="http://twitter.com/YOURTWITTERID" class="twitterlink"><img src="http://YOURURL.com/wp-content/themes/pagelines/sections/branding/twitter.png" alt="Twitter"/></a><a target="_blank" href="http://facebook.com/YOURFACEBOOKPAGEURL" class="facebooklink"><img src="http://YOURURL.com/wp-content/themes/pagelines/sections/branding/facebook.png" alt="Facebook"/></a><a target="_blank" href="http://linkedin.com/YOURLINKEDINID" class="linkedinlink"><img src="http://YOURURL.com/wp-content/themes/pagelines/sections/branding/linkedin.png" alt="LinkedIn"/></a><a target="_blank" href="http://youtube.com/YOURYOUTUBEID" class="youtubelink"><img src="http://YOURURL.com/wp-content/themes/pagelines/sections/branding/youtube.png" alt="Youtube"/></a><a target="_blank" href="https://plus.google.com/YOURGOOGLEPLUSID" class="gpluslink"><img src="http://YOURURL.com/wp-content/themes/pagelines/sections/branding/google.png" alt="Google+"/></a></div></div>

<script type="text/javascript">

jQuery('.icons a').hover(function(){ jQuery(this).fadeTo('fast', 1); },function(){ jQuery(this).fadeTo('fast', 0.5);});

</script>

Just copy and paste the code above into a footer widget (it also appears to work in sidebar widgets) and you'll have those beautiful social icons - with that great hover effect - in your footer. Obviously, in the code above, you'll need to replace YOURURL with the actual URL for your site. You'll also need to replace YOURTWITTERID, YOURFACEBOOKPAGEURL, and other social profile links with your own. If you didn't want to use one of the social icons, then simply select and delete the code for it between the opening <a and closing </a> tags. Note: you may have to add/modify some CSS in order to make them display exactly how you want them to - e.g. I added the following CSS (to remove the absolute positioning and to center-align the icons inside the footer widget):

.section-branding .icons {

position: static;

width: 192px;

margin-left: auto;

margin-right: auto;

}

Depending on the number of icons you use, you'll need to adjust the width accordingly (I'm using six, for which 192px seems to be correct).

Anyway, hope this is useful.

1 person likes this

Share this post


Link to post
Share on other sites

6 answers to this question

Posted · Report post

Hi Jim, I'm assuming you've resolved this as I can no longer see the code appearing on your site before the icons.

 

http://screencast.com/t/E64hSIVwHMK

Share this post


Link to post
Share on other sites

Posted · Report post

No worries, Mackenzie.

Share this post


Link to post
Share on other sites

Posted · Report post

:D

Share this post


Link to post
Share on other sites

Posted · Report post

The topic was marked as resolved.

Share this post


Link to post
Share on other sites

Posted · Report post

Thank you for taking the time to write this out and share :)

1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

First of all this is great and I have it almost working, but I'm wondering if there is a typo in the code above?

 

I've installed this at: http://businesstravelexclusive.zippysites.com/

 

You'll notice I'm getting:

 

icons" style="bottom: 12px; right: 1px;">

 

displaying before the icons.

 

I am using this in a universal sidebar installed in the header so maybe that is my problem?

 

I'm not much of a CSS coder but I also notices only two closing </div> and five opening <div> as well as no closing </section>

 

Any help would be greatly appreciated!

 

Thanks again for coming up with this if I can get it to work it's a perfect solution to our current need.

 

Jim :)

Share this post


Link to post
Share on other sites
This topic is now closed to further replies.