Jump to content
Sign in to follow this  
zhonghao

Add a social network icon

Recommended Posts

zhonghao    1
zhonghao

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.

Share this post


Link to post
Share on other sites
catrina    103
catrina

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.com/docs/base-child-theme) or to your footer by using a text widget in a sidebar.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

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.

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

<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

Share this post


Link to post
Share on other sites
Rob    547
Rob

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.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

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.

Share this post


Link to post
Share on other sites
Rob    547
Rob

Keep us posted!


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

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.com/wiki/How_to_Use_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

Share this post


Link to post
Share on other sites
Rob    547
Rob

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.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

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

Share this post


Link to post
Share on other sites
James B    436
James B

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


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

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

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

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 !

Share this post


Link to post
Share on other sites
Rob    547
Rob

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


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

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.

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

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

Share this post


Link to post
Share on other sites
James B    436
James B

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


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
James B    436
James B

Hi Richard

We've had a quick look at your site and the code provided. It doesn't look like you've created the images folder which needs to go in, eg: /platformbase/images. Can you check on this and let us know where you've uploaded the icon image?


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

Hi James thanks for the reply. I uploaded the images to the the same 'images' folder as provided in the platformbase program. It is the same folder where the image 'sprite-socialicons.png' is located. I have uploaded 2 screen shots from my ftp program for you to see as follows :

http://paste.pagelines.com/80q & http://paste.pagelines.com/2ma

Thanks again

Share this post


Link to post
Share on other sites
James B    436
James B

Hi Richard, ok I've got someone to look over the hook for you and check the screenshots. They've said you'll need to add the full url to the image in the css code at the bottom of the paste you attached.

For example: http://www.mystie.com/wp-content/themes/platformbase/images/myimage.png, apparently relative urls won't work. Check the exact path to the image as in the css code it says platformpro not platformbase. Also the link you've included is coming up inactive, it will still take you to the main site but there's no profile there for you at the moment.

Sorry I missed your previous message, I know Walton on Thames well, I'm based near Guildford.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
zhonghao    1
zhonghao

Thanks James - can't believe I missed the wrong url (platformpro instead of platformbase) sorry about that ! So I now have changed the url in the css to the full address s pe the attachment (http://paste.pagelines.com/9ay). However it is still not showing. I have checked and rechecked and rechecked again to make sure I'm in the right folder. Maybe the way I've written the url is wrong ?.....

I'm aware of the inactive link. I need to find a Chinese computer literate person to help sort that one out :)

Guildford - I noticed the times of your posts - don't you sleep !?

Thanks for the help so far - really appreciate it

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi Richard,

OK I have tested your code and it wasn't correct, therefore, I have resolved this for you. Simply add the following code below.

// Add this to your Custom CSS


.icons .richardweibo {
background: url('http://bodyworksasia.cn/wp-content/themes/platformbase/images/weibofollowus-sml.png') no-repeat 0 0;
width: 79px;
height: 25px;
}

.icons .richardweibo:hover {
background: url(http://bodyworksasia.cn/wp-content/themes/platformbase/images/weibofollowushover-sml.png) no-repeat 0px 0px;
}[/CODE] // Add this to your functions.php
[CODE]


add_action('pagelines_branding_icons_end', 'weibo_icon');
function weibo_icon(){ ?>

<a href="http://www.weibo.com/Richard_Brown" class="richardweibo"></a>

<?php

}



Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • janpeeters
      By janpeeters+
      Over the last month I had extensive communications with the developer of the (premium) Anything Boxes section (in Pagelines store) (Adam Munns) and the developer of the WP Polylang Multilingual plugin (Frederic Demarle).
       
      This was because the following problem occurred:
      Anything Boxes showed all posts of two languages (Dutch and English) on the respective static frontpages for each language. It should of course have filtered posts for Dutch language on the Dutch frontpage and English on the English frontpage.
       
      The solution to this problem was simple in the end. When duplicating a page for use in another language the settings for Anything Boxes were not copied to the new page and I should have set these settings manually again on the new page. I wasn't aware of this, but it makes sense. Because of this the pages didn't know how to differentiate between posts from different languages.
       
      The dev of Polylang told me that Polylang is currently smart enough to synchronize metas like Featured images and page templates but it does not work out of the box with metas created by plugins and themes but (according to Frederic) it is rather easy to add them in the list using the filter 'pll_copy_post_metas'.
      He mentions that he is not sure that these 'PageLines Meta Settings' are stored in post meta but that would make sense according to him. He asks if the Pagelines dev team will be interested to support this feature in the future.
       
      I'm also wondering if you will consider adding Polylang translation support for manually editable strings like the 'Read more…' strings in Pagelines Settings.
       
      Well that's of course up to you but I thought to let you know to be able to take this into consideration. I also post this for other users in case they experience the same kind of trouble and are looking for an answer.
       
      Best regards,
      Jan Peeters
    • bankrollbuilder
      By bankrollbuilder
      I used a custom hook to put a banner ad in my header. It works but its not in the right position. it is centered and above my logo and I would like to float it to the right of my logo in the header. heres the link: http://shaboopie.com/shaboopie-wp/free-logos-pg1/

      thanks.

      Dan B.
    • starlit
      By starlit
      Can one have two hero sections on one page?

      I want a landing page which leads/advertises two subpages.

      Or is there another option?

      Please help.

      THANK YOU
    • hutruk
      By hutruk
      Hi!

      I am using the shortcodes for tabs, as described in the documentation.

      When I insert the following code:


      [pl_tabs][pl_tabtitlesection type="tabs"] [pl_tabtitle number="1"]Title 1[/pl_tabtitle] [pl_tabtitle number="2"]Title 2[/pl_tabtitle] [/pl_tabtitlesection] [pl_tabcontentsection] [pl_tabcontent active="yes" number="1"] Lorem ipsum dolor sit amet, consectetur adipiscing elit [/pl_tabcontent] [pl_tabcontent number="2"] Lorem ipsum dolor sit amet, consectetur adipiscing elit [/pl_tabcontent] [/pl_tabcontentsection] [/pl_tabs]

      I get a strange output (in the attachment).

      Any ideas?

      Thanks in advance!

    • MooiWeb
      By MooiWeb
      Hello,

      I would like to align my qtranslate with my breadcrumb so that the flags are on the same hight.
      I'm aware of putting a code in the custom css and tryed severall codes from your site but for now, no succes

      The site i'm working on is http://nieuw.vazdias.nl

      Thx,
      Edwin



×