So I added a StumbleUpon sharing button …

Posted in: Newspaper
Post count: 66

I’ve seen a number of people asking how to add LinkedIn and StumbleUpon sharing buttons to the theme. I managed to add both using/adapting some tips here on the forum, and with that I was able to ditch the sharing plugin I’d been using.

I could still use help with a couple of things, but first I’ll share the steps I used to add these buttons:

1. Adding this code to td_module_php for LinkedIn:


<a>title, ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8') . '&source=' . urlencode(get_bloginfo('name')) . '" onclick="window.open(this.href, \'mywin\',\'left=50,top=50,width=600,height=350,toolbar=0\'); return false;"><i class="fa fa-linkedin"></i></a>

And for StumbleUpon:


<a>title, ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8') . ' - ' . urlencode( esc_url( get_permalink() ) ) . '" ><i class="fa fa-stumbleupon"></i></a>

2. Adding Font Awesome 4 Menus

3. Adding this custom CSS:

.td-social-linkedin{
margin-left:8px;
background-color:
#006699!important;;
}

.td-social-stumbleupon{
margin-left:8px;
background-color:
#eb4823!important;;
}

Now here’s what I could use help with:

1. How to have Stumbleupon sharing open a new dialog rather than taking users out of the site?
2. Left spacing for Stumbleupon button is uneven – I wasn’t able to fix that by decreasing the left spacing via CSS
3. Which files should I tweak to add these buttons to the bottom sharing bar and the mobile theme?

Thanks in advance!

Post count: 66

Sorry, don’t know why the code came out wrong … trying again:


<a>title, ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8') . '&source=' . urlencode(get_bloginfo('name')) . '" onclick="window.open(this.href, \'mywin\',\'left=50,top=50,width=600,height=350,toolbar=0\'); return false;"><i class="fa fa-linkedin"></i></a>

<a>title, ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8') . ' - ' . urlencode( esc_url( get_permalink() ) ) . '" ><i class="fa fa-stumbleupon"></i></a>
Post count: 22421

Hi,

Thank you for sharing your implementation method.

1) The action that the button does is added by the code you implement. If your code simply leads to the page, then that is what it will do. If you want it to perform some other action, you must add it into the code.
2) The spacing can be adjusted with css.
3) In the same file you will find the article bottom sharing options that resemble the first code. you just have to scroll a bit further down.

Thank you!

Post count: 66

Thanks! What file should I edit to add a sharing button to the mobile theme?

Post count: 23312

Hello colecoboy84,

If you want to edit the sharing button to your mobile theme, you will have to alter the code from the td_module_single_mob.php core file, like this -> http://screencast.com/t/2ZaPrQFGx

Thanks for your understanding!

Post count: 15

Hi,

td_module_php doesn’t exist in my Theme. Where specifically does one find it? Thanks!

Post count: 23312

Hello Truefolder,

Please notice that the td_module.php core file is placed in wp_booster core, like this -> http://screencast.com/t/DLW0vdv9

Hope this helps!

Thanks.

Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.