how to add a facebook icon next to rss icon at the top of theme
-
Admin
Did you put the codes in the theme’s functions.php or your child theme’s functions.php?
Hi Syahir,
I tried putting the code in the theme’s function.php (that is where I had it before the update), but when I did the update it wrote over it. That’s fine. So I read up on the topic and realize that I need to create a child theme functions.php file so this won’t happen again. So I just did that, along with having a style.css file since I read that you have to have a style.css file in any child. No problem.
Now I’m trying to use the code that Andrewjs18 wrote a few months back. I had this code in the theme’s functions.php before and it seemed to work just fine. If I remember right, I placed it near some coded that had to do with the RSS feed and it put some buttons on the top of the page for me.
This is the code that I used after inputting my own settings.
<?php
function graphene_social_icons(){ ?>
<a href="http://www.facebook.com/group.php?gid=246817092236" title="Visit the CSI Homebrew Club on Facebook"><img src="http://csibrewers.org/content/wp-content/uploads/2010/12/facebook.png"></a>
<a href="http://www.twitter.com/csibrewers" title="Visit the CSI Homebrew Club on Twitter"><img src="http://csibrewers.org/content/wp-content/uploads/2011/02/twitter.png"></a>
<a href="https://spreadsheets.google.com/viewform?formkey=dDVMdXhSaDc4MnNkYzQ4ZTRNa2lyNmc6MQ" title="Join the CSI e-mail list"><img src="http://csibrewers.org/content/wp-content/uploads/2011/02/email.png"></a>
<?php
}
add_action('graphene_feed_icon','graphene_social_icons');
?>So the question is “is this coded still applicable with the new version of Graphene and if so, where should I put it?
Right now in my “graphene-child” folder I have a style.css file that I have done some minor look and feel changes to the code. That seems to be ok. Also in that folder I have a copy of theme’s functions.php that I have copied over from the “graphene” folder. This is untouched.
Any help you could profile would be awesome!!!
Thanks so much,
Brent
Admin
It should be working with the new update. Also, do not copy the theme’s functions.php file into the child theme’s folder. Create an empty functions.php file, and add codes there as necessary.
So what does the “social sharing button” area of the setup actually do? Seems like the purpose is to drop in your code and have your button/link show up in the top bar next to the RSS button, right? Is that not the functionality. I can certain hard code this in, but if this works that is certainly a better way to go.
Admin
The “social sharing button” option in the theme’s options page is for the post’s sharing buttons, not the site’s. If enabled and the codes added, the social sharing buttons will be displayed at the bottom right of the post.
What is being discussed in this thread is how to add additional icons and links to the top of the theme, where the RSS button is located. There’s no options for that, so it has to be coded in using a child theme.
Thanks for clarifying, its not really clear in theme setup what that does and where it goes, maybe just a description line added there would help.
As for the top bar, it would be a great addition to the theme to add a way to add these in the setup (like above) and have them appear next to the RSS icon. I want to do this so I guess I’ll just hard code that in.
Maybe as a suggestion for development, have a setup area just for that top bar which asks:
Include RSS icon?
Include additional social icons:
Enter code for 1 or more here…
Include search box
Additional HTML:
Enter code here.
That would be cool. Great theme BTW.
I just edited the CSS file for the header for http://schmidtysays.com
I replaced the <div id=”rss”> with these piece of code:
<div id="rss">
<a href="http://schmidtysays.com/feed/" title="Subscribe to RSS feed"><span>Subscribe to RSS feed</span></a>
<a href="http://twitter.com/schmidtysays" title="Visit my Twitter Page"><span>Visit my Twitter Page</span><img src="http://schmidtysays.com/wp-content/Images/twitter.png" alt="My Twitter Page" /></a>
<a href="http://facebook.com/schmidtysays" title="Visit my Facebook Page"><span>Visit my Facebook Page</span><img src="http://schmidtysays.com/wp-content/Images/facebook.png" alt="My Facebook Page" /></a>
<a href="http://youtube.com/classysexybitch" title="Visit my YouTube Page"><span>Visit my YouTube Page</span><img src="http://schmidtysays.com/wp-content/Images/youtube.png" alt="My YouTube Page" /></a>
<a href="http://www.flickr.com/photos/schmidtysays/" title="Visit my Flickr Page"><span>Visit my Flickr Page</span><img src="http://schmidtysays.com/wp-content/Images/flickr.png" alt="My Flickr Page" /></a>
<a href="mailto:me@schmidtysays.com" title="Send me an Email"><span>Send me an Email</span><img src="http://schmidtysays.com/wp-content/Images/email.png" alt="Send me an Email" /></a>
</div>Thanks Syahir…I think I was just getting in a little over my head with trying to spin up on the child themes and how they work. I need to learn a little more about WordPress and PHP coding before I should head down that road.
I’ve gone ahead and done what schmidtysays did with her site. This worked out great and I was able to restore the code. I should have thought of doing this in the beginning, but then again I’m still learning.
Thanks for the help and for creating the best theme out there!!!
-Brent
Graphene Child:(functions.php)
<?php
function graphene_social_icons(){ ?>
<a href="http://www.yoursite/?page_id=861" title="Send message"><img src="http://www.yoursite/wp-content/uploads/m-4.png" /></a>
<a target="_new" href="https://forum.graphene-theme.com/" title="Graphene theme Forum"><img src="http://www.yoursite/wp-content/uploads/web1.png" /></a>
<?php
}
add_action('graphene_feed_icon', 'graphene_social_icons');
?>Graphene Child: Stylesheet (style.css)
#rss a{
margin-left:10px;
}
#rss a.rss_link{
margin-left:23px;
}This works for me.
You can use or add any link and 29px picture u like.
Kim
- You must be logged in to reply to this topic.
