Jump to content


Photo
- - - - -
Resolved

How do I add additional Social Icons

branding social icons

  • Please log in to reply
15 replies to this topic

#1 millera4

millera4

    Member

  • Members
  • 26 posts

Posted 12 October 2012 - 04:19 PM

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 :

Please Login or Register to see this Hidden Content



#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 12 October 2012 - 04:26 PM

You'll need to use a hook to add the social icons, but first you need to make sure that you're using the base theme (editing core files isn't allowed):

Please Login or Register to see this Hidden Content



#3 millera4

millera4

    Member

  • Members
  • 26 posts

Posted 12 October 2012 - 05:40 PM

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

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 12 October 2012 - 07:00 PM

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?

#5 millera4

millera4

    Member

  • Members
  • 26 posts

Posted 12 October 2012 - 07:16 PM

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

#6 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 12 October 2012 - 07:46 PM

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

Please Login or Register to see this Hidden Content



#7 millera4

millera4

    Member

  • Members
  • 26 posts

Posted 12 October 2012 - 08:48 PM

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

#8 millera4

millera4

    Member

  • Members
  • 26 posts

Posted 12 October 2012 - 08:59 PM

i still get the same error when i press update after typing in ...


<a href="

Please Login or Register to see this Hidden Content

src="

Please Login or Register to see this Hidden Content

icon.png" border="0">
</a>

i did not delete anything from that page..........just added the above code to the bottom of the fuctions.php file

#9 James B

James B

    Advocate

  • Moderators
  • 4979 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 12 October 2012 - 10:45 PM

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.

#10 mackenzie

mackenzie

    Advocate

  • Members
  • 333 posts
  • Country: Country Flag

Posted 12 October 2012 - 11:01 PM

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.

#11 millera4

millera4

    Member

  • Members
  • 26 posts

Posted 13 October 2012 - 01:39 AM

ok i fill fix that thanks james

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

#12 millera4

millera4

    Member

  • Members
  • 26 posts

Posted 13 October 2012 - 01:52 AM

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

#13 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 13 October 2012 - 04:59 PM

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="

Please Login or Register to see this Hidden Content

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

#14 millera4

millera4

    Member

  • Members
  • 26 posts

Posted 13 October 2012 - 07:21 PM

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.

#15 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 13 October 2012 - 07:50 PM

Excellent.

#16 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 13 October 2012 - 07:50 PM

The topic was marked as resolved.
  • mikezielonka likes this





Also tagged with one or more of these keywords: Resolved, branding social icons