Jump to content


Photo
Resolved

Add a social network icon

Weibo

  • Please log in to reply
26 replies to this topic

#1 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 04 October 2012 - 01:32 PM

I live in China and my website is hosted in China. I would like to add a button for WeiBo which is the Chinese equivalent of 'Twitter' on my web page. I have some code which my friend obtained from the WeiBo website but I need help to know how and where to insert the code which I think (!!!) should create a button for me so that people can click it to follow me on the WeiBo. I would like the button to appear either in the header or the footer of the web page.

Any help would be greatly appreciated.

#2 catrina

catrina

    Advocate

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

Posted 04 October 2012 - 02:22 PM

Was the code that you were given HTML code for adding the icon? If so, you can add it your header by using a hook in the child theme (as referenced here: http://www.pagelines...ase-child-theme) or to your footer by using a text widget in a sidebar.

#3 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 04 October 2012 - 03:29 PM

Thank you for such a prompt reply. Unfortunately it is late evening here and the code is on my computer at work so I can post it tomorrow for you to see. Sorry but I have no idea what HTML code looks like. Thanks and regards, Richard.


#4 catrina

catrina

    Advocate

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

Posted 04 October 2012 - 04:33 PM

Okay, no worries.

#5 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 05 October 2012 - 02:08 AM

<span id=" followBtn"></span>

在已初始化的Javascript Client代码里,添加代码,将You Weibo User ID换成你想要关注的人的UID

<script type="text/javascript">
WB.core.load(['connect', 'client', 'widget.base', 'widget.atWhere'], function() {
var cfg = {
key: 'YOU APP KEY',
xdpath: '你的跨域文件URL(http://yourdomain/xd.html)'
};
WB.connect.init(cfg);
WB.client.init(cfg);

//follow you on sina weibo
WB.widget.base.followButton(You Weibo User ID, document.getElementById("followBtn"));
});
</script>Hi here's the code I was supplied :

Thanks again

#6 Rob

Rob

    One Smart Egg

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

Posted 05 October 2012 - 08:25 PM

First, you can add that code to a hook.

You'll need to do several things. Go through our docs for PlatformPro at http://www.pagelines.com/docs and read about customizations. An example of a hook is given in a video there. The change will be made in PlatformBase in functions.php.

Be sure to wrap the hook in a div with a unique class, so you can later style it in Custom Code > CSS Rules.

Make sure you edit that code to include changes suggested, such as your APP key and proper URL for the site.

Save the functions.php.

Check it. Use CSS to move it, position it, and apply any other customization.

#7 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 06 October 2012 - 03:50 AM

Hi Rob, thanks very much for your reply and help. Unfortunately even after checking out the link you supplied I still don't understand a word ! :) Was kinda hoping I could just paste the code somewhere and the button would 'magically' appear. I'll try to find a computer expert over here and see if they can use your help to get it done. Thanks to Catrina as well. Regards Richard.

#8 Rob

Rob

    One Smart Egg

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

Posted 06 October 2012 - 07:25 PM

Keep us posted!

#9 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 10 October 2012 - 04:01 AM

So nobody seems to understand anything about anything over here ! So please I would be really grateful if you can spare some time for someone completely ignorant of all things regarding 'computer jargon'. I've spent quite some time going over the forums and docs and the link you gave regarding 'hooks'. You inform me that the changes will be made in PlatformBase so is this the Base Theme available in the store which I have to download and install ? The video with the guy demonstrating how to put in a hook makes no mention of how to go step by step to get to his starting position in the first place. I found the Base Theme on your store and found the following guide on how to install it (http://www.pagelines..._the_Base_Theme) - The instructions are to go to the Pagelines Panel in the WP admin panel and select 'Store' .... etc. However I don't see or have a Pagelines Panel in the WP Admin area - I only have Platformpro and Settings .... ? Any step by step instructions on how to install - access the Base Theme and the files for customizing would be appreciated. I'll then try to play around with things myself for a while and try to make sense of it. I am running Platform Pro 1.5.0 Thx

#10 Rob

Rob

    One Smart Egg

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

Posted 10 October 2012 - 09:28 PM

First, you should update from PlatformPro 1.5.0 to PlatformPro 1.5.3, and should also install PlatformBase 1.4.1. Both are available at your Launchpad account. http://www.pagelines.com/launchpad

The Base theme in the store is for PageLines Framework and you say you're using PlatformPro. So, Base theme won't work with PlatformPro; you need PlatformBase, from your Launchpad accuont.

In Dashboard > Appearance > Themes, you should activate PlatformBase.

If you then FTP to wp-content/themes/platformbase, you will find a file there, called "functions.php".

Inside that file, you'll find an example of how to add stumbleupon as one of the social media icons.

You can copy the hook. Probably 'pagelines_before_branding".

And just like the example, you can then paste your code.

#11 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 11 October 2012 - 01:29 PM

Thanks for your help Rob - seems to makes sense. Gonna take a couple of days to look at it and upgrade the website but I'll let you know how I get on. Many thanks - Richard

#12 James B

James B

    Advocate

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

Posted 12 October 2012 - 03:58 AM

Ok Richard, we'll leave this thread open for you, pop back to us when you're ready :)

#13 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 13 October 2012 - 03:50 PM

Hi Rob / James : So I managed to upgrade/update to Platform Pro 1.5.3 and install PlatformBase 1.4.1 and the website seems to be fine (minor change in the menus but simple to fix). However when I use my FTP program to navigate to 'wp-content/themes/' there is no folder/file called platformbase, only the twenty twenty theme and platformpro (as noted in the theme installation which states that the name must be in lower case). Any suggestions on where the platformbase folder may be so I can access the functions.php file ? I took 2 screen shots to show you the installed and active platformbase theme and also my ftp 'themes' folder but can't find a way to attach them. If I click the media button in the 'Reply to this topic' box I just get a box to place the url but the image is on my computer.

Also on another note James I see you are located in Surrey UK. Thats where I'm originally from. I'm from Walton on Thames - how about you ?
Cheers

#14 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 13 October 2012 - 04:02 PM

Ok that's just weird - turned the computer of and on. Then signed in again to the FTP program (Fetch) and now the platformbase folder is there along with pagelines-template-theme folder. Will try the rest later in the week and keep you posted. Thanks very much for the help so far !

#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:47 PM

pagelines-template-theme is the base you tried to use from earlier. Leave it there as it's doing no harm.

#16 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 16 October 2012 - 05:40 AM

Hi Rob, Could you please tell me how I can attach a file in my 'Reply to this topic'. I made an icon which I placed in the images folder and used the functions.php and .css files as best I can understand to make the icon show as a link to the weibo page. It would be great if I can attach screen shots of the files for you to look at and tell me what I missed - if that's possible.

#17 Danny

Danny

    Is Awesome!

  • Moderators
  • 15194 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 16 October 2012 - 08:31 AM

Hi,

Add any code you wish to share to our paste service - http://paste.pagelines.com/

Add any of your screenshots to - http://imgur.com

#18 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 16 October 2012 - 11:34 PM

Hi Danny - thanks. I just pasted the code I've used. Hope you guys can get it ok.

#19 James B

James B

    Advocate

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

Posted 17 October 2012 - 12:44 AM

Hi Richard,

When you use the paste pin you need to copy the link and then paste it into this thread so we can access it. :-)

#20 zhonghao

zhonghao

    Super Member

  • Members

  • 101 posts
  • Country: Country Flag

Posted 17 October 2012 - 02:06 AM

Thanks James :
http://paste.pagelines.com/1da





Also tagged with one or more of these keywords: Resolved, Weibo