When designing my photography website (using WordPress with a Photocrati template as a base), I tried a number of different plug-ins for my ‘contact me’ and ‘follow me’ icons without much success. I didn’t find any that did what I wanted them to do – if you want custom buttons in your header like the one on my site then maybe think about this option.
I wanted buttons to view at the top right of the page which meant putting them in the header. I also wanted to have bespoke buttons that matched the feel of my brand. The answer for me was code it myself rather than relying on a plug in. I don’t pretend to be an expert on coding but it has worked for me and perhaps you’d like to do something similar.
WARNING: this involves altering your theme files – make sure you make a copy or backup of your files before altering anything – I take no responsibility for any errors you cause by altering your theme files on you website.
This tutorial assumes you are using WordPress and Photocrati as you base with a similar layout to my website – it worked for me but I can’t guarantee it will work on your site without further work:
- Decide on the icons you want to use for your buttons and upload them to a folder on your WordPress site (I’m using NextGEN Gallery).
- Log in to WordPress as Admin and go to Appearance—>Edit Themes then select the Header.php from the list on the right hand side.
- Take a copy of the header code and save it on your computer in a text editor.
- Go to my page on how to make follow me buttons in WordPress and copy the first batch of code from that page.
- Open it in your editor and replace any CAPITAL LETTERS with the relevant URLS for your social media sites and the URLs of the icons you uploaded in step 1. This code has lines for Facebook, Twitter, Pinterest and Email. If you want to add more, just copy the layout of the ones shown, changing the URLs as required. SAVE THIS FILE ON YOUR COMPUTER.
- Copy the code with your URLs now inserted in it and go back to the Header.php file in step 2.
- Do a search (cmd F on the mac) for <div id=”branding”>. It should show you only one result, right near the bottom of the file.
- Paste your new code after <div id=”branding”> and before <div id=”blog-title”>
- Making sure you did take a back up copy of the header.php code as per step 3, hit the Update File button.
- Open up your website in google Chrome and select your header with a right click—>inspect element.
- You should see <div id=”branding”> highlighted. I have reduced the width of this div using some css so the buttons fit in to the right of it as follows:
- Go back to my page and copy the second bit of code.
- Paste this code into your custom css (in photocrati go to: Theme Options—>Other Options—>custom Css)
- Go back to my page and copy the third bit of code.
- Paste this code into your custom css (in photocrati go to: Theme Options—>Other Options—>custom Css)
- You will now need to adjust the parameters within the css to position your buttons correctly on the right hand side of your header…it was a matter of trial an error for me.
NOTE: when you update your theme in the future, the header.php file will be overwritten. You will need to go back and repeat steps 6-9 once the upgrade is complete using the file you saved in step 5.
I hope that helps get you started if you are looking for this kind of solution to social media contact buttons – thanks for reading.
–
Bio: Peter Marfleet is a family, maternity and newborn Portrait Photographer in Harrogate, UK.
Wayne Baker says
Nice work I’m building a new WP site right now and was wondering about this only about an hour ago so thank you 🙂
Peter says
Wayne, you’re welcome – hope it works ok for you, Pete
martha hart says
Nice job – I think it adds to the look of the site, when these are customized. I did it too.
Eric Seale says
Excellent article! There’s one more thing you might want to try, though. A lot of WordPress theme frameworks support defining “child themes.” This way, you could define a “child” of Photocrati, make your mods to it, and the mods wouldn’t get blown away every time Photocrati gets updated.
Do a quick web search on “Photocrati child theme,” and you’ll find a number of sites with instructions on how to do this.
Peter Marfleet says
@martha, thanks and agree – can’t stand ‘canned’ template looks on websites.
@Eric, thank you for that extra tip…will look it up #addtotheknowledge
cheers, Pete
MARK BOLTON says
that looks perfect… would love to do it, but , even with your excellent instructions I would be wary of doing my own site adjustments… Id love someone to do this as a plugin… is there one? I also use Photocrati and do all my own wordpress site, but actually changing the php etc is a step too far for me I think! thanks, nice looking site too! Mark
Charles says
Might make some changes to my blog. Thanks for the tut