Archived

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

  • 0

Resolved How do I add additional Social Icons


Question

Posted · Report post

I am using

PageLines v2.3 and wanted to know How I can add a tumblr and pinterest social icon to the branding section at the top of my website.

I have the images of the pinterest and tumblr social icons already uploaded to what I believe is the right folder:

wp-content/themes/pagelines/sections/branding/

But know i need to find the CSS file or file in which I can change the code to for them to display in the branding section.

Would anyone know the best way to customize this and add more social icons to the branding section ?

should i try to find the main CSS or Php file for this pagelines customization?

Here is my website....I'm still working on it : www.ajmdesign.ca

Share this post


Link to post
Share on other sites

15 answers to this question

Posted · Report post

Thanks for your help Catrina!

I have now installed the base theme, so in the functions php file of the base theme in the apearance edit panel in wordpress can I now add a hook... I only know a little CSS and ...so I was wondering if this linkedin hook I modified from the funtions php file in the branding folder will work...all i changed was the image link to the pinterest image at the end.

.....or should I be writing a totally different code to add the pinterest social icon so I dont have to change the LinkedIn one?

if(ploption('linkedinlink'))

printf('<a target="_blank" href="%s" class="linkedinlink"><img src="%s" alt="LinkedIn"/></a>', ploption('linkedinlink'), $this->base_url.'/pinterest icon.png');

Hope i'm not asking to many things in one post....

Share this post


Link to post
Share on other sites

Posted · Report post

You can add different code instead, but it depends on how your want the buttons to function. For example, do you want your Pinterest button to link to your Pinterest page or do you want it to work like a "Pin It" button?

Share this post


Link to post
Share on other sites

Posted · Report post

I want the button to send the user to my pinterest page

Share this post


Link to post
Share on other sites

Posted · Report post

Okay, then all you had to add is an image link like this:


<a href="http://YOURPINTERESTPAGELINK"><img src="http://DIRECTURLFORPINTERESTICON" border="0"></a>

Share this post


Link to post
Share on other sites

Posted · Report post

ahhh...

The site is not showing up now for some reason.... after copied and paste the code i just pressed update at the bottom of the functions.php page in wordpress ....i just wanted to save the code before i found the direct url for the image. after i pressed update the screen went blank with the error message

Parse error: syntax error, unexpected '<' in /home/content/01/7092701/html/wp-content/themes/pagelines-template-theme/functions.php on line 32

....the site is not showing up....either it says the same thing...

Share this post


Link to post
Share on other sites

Posted · Report post

Hi there, I think you've positioned the code in the wrong place or missed a piece out. In order to get the site back online you'll need to go in via FTP and find the functions.php. Edit that line of code out of the functions.php and re-save.

Share this post


Link to post
Share on other sites

Posted · Report post

Did you make the changes directly to the PHP page or in a hook? We usually suggest no changing PHP files directly and instead use hooks to make the changes.

Share this post


Link to post
Share on other sites

Posted · Report post

ok i fill fix that thanks james

Hi mackenzie...I made changes to the functions php page within wordpress.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks James B! That worked! I see my site again. Now I just need to see if i can add this pinterest button still

Share this post


Link to post
Share on other sites

Posted · Report post

First, the functions.php we refer to in hook instructions is always the one in the child theme. We never recommend editing core files. I apologize if there was any confusion about that. Editing core files usually results in errors and a broken site. Please make sure you've not left any changes in any functions.php except the correct one in a child theme.

Just as a primer on hooks, this is from a previous version, but still applies today for the base theme's functions.php (which is where the hook belongs):

// HOOKS EXAMPLE --------//

// Below is an example of how you would add a social media icon to the icons in header (branding section)

// We have placed a hook at the end of the icon set specifically add new icons without modifying code or having to worry about your edits

// getting thrown out during the upgrade process. The way to use hooks goes a little like this:

// add_action('hook_name','function name');

// ---> uncomment to load

//add_action('pagelines_branding_icons_end', 'add_icons_to_branding');

// 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

?>

<a href="http://www.stumbleup...ler/pagelines/" class="stumbleupon"></a>

<?php }

// end function

The corresponding CSS looked like this:

.icons .stumbleupon {background: url('../platformpro/images/sprite-socialicons.png') no-repeat -176px 0;}

.icons .stumbleupon:hover {background: url('../platformpro/images/sprite-socialicons.png') no-repeat -176px -22px;}

Obviously, the URLS for the images are outdated. And the values of the images (-176, etc) would have to be changed

Share this post


Link to post
Share on other sites

Posted · Report post

ok so if you go to my website now I have changed the LinkedIn button & Youtube button by changing the png image in the Hooks Section for the social icons in the

section.php file that is located in the branding folder . then i just added the links in the header and footer section in base theme global settings. the problem seems to be resolved.

Share this post


Link to post
Share on other sites

Posted · Report post

Excellent.

Share this post


Link to post
Share on other sites

Posted · Report post

The topic was marked as resolved.

1 person likes this

Share this post


Link to post
Share on other sites