Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Insert custom "share" code at top of forum
Avatar
Trevor Lyman
Member
Free Members
sp_UserOfflineSmall Offline
Apr 19, 2014 - 12:13 pm

Hello,  I'm brand new to simple-press.com.  Thanks for your help in advance.

Instead of using the sharethis plugin I want to use the sharing code from Po.st

So basically, I need to know how to insert code so that my share buttons will show up at the top of a forum post.  I do not want the share buttons to show up in every post in the thread.

Can you help?  Thanks.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 19, 2014 - 12:32 pm

you will need to just add it to your sp theme where you want... they are a series of template files just like a wp theme...  so you can add whatever you like where ever you like...

if I understand where you want it, that would be on topic view (list of posts) so you would edit the spTopicView.php template file in your sp theme...  if  you want it before the list of posts, then probably right before the post loop (yup, just like wp):

                        if (sp_has_posts()) : while (sp_loop_posts()) : sp_the_post();

as always, we strongly recommend that you make your own theme and not edit one of ours since you will lose any changes on updates...  see: http://codex.simple-press.com/.....g-a-theme/

Avatar
Trevor Lyman
Member
Free Members
sp_UserOfflineSmall Offline
Apr 19, 2014 - 6:56 pm

Thanks for your help.  I created a new template and I'm not at the spTopicView.php file.

I'm still a little lost as to where and how I would add this code:

<div class="pw-widget pw-counter-vertical">
<a class="pw-button-facebook pw-look-native"></a>
<a class="pw-button-twitter pw-look-native"></a>
<a class="pw-button-googleplus pw-look-native"></a>
<a class="pw-button-email pw-look-native"></a>
<a class="pw-button-reddit pw-look-native"></a>
<a class="pw-button-stumbleupon pw-look-native"></a>
<a class="pw-button-post-share"></a>
</div>
<script src="http://i.po.st/static/v3/post-widget.js#publisherKey=qm9qq81pb5131cg36q4a&retina=true" type="text/javascript"></script>

Thanks.

Avatar
Trevor Lyman
Member
Free Members
sp_UserOfflineSmall Offline
Apr 19, 2014 - 7:54 pm

OK, I didn't realize you were telling me to search for that snippet of code and then put the echo statement with my code after that.  I figured that part out.  I actually moved the code to the section above the one you gave and it shows up one time and where I want it.  So, that's progress!

The problem now for me is that is jumbles the buttons and they don't look like they work so they won't work yet.

You can see it live here: 

http://libertycrier.com/forum/.....-nails-it/

screenshot:

forum-post-buttons.jpgImage Enlarger

Any thoughts on how to fix this?

Avatar
Trevor Lyman
Member
Free Members
sp_UserOfflineSmall Offline
Apr 19, 2014 - 8:02 pm

It doesn't seem to show up at all on Firefox.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 19, 2014 - 9:00 pm

it shows up fine in firefox for me...  looks like the html code you entered expects some css styling...  hard to tell what since not at all familiar with that api...

does this stuff work elsewhere in wp?  how does it get css styling then?

Avatar
Trevor Lyman
Member
Free Members
sp_UserOfflineSmall Offline
Apr 19, 2014 - 9:31 pm

My guess is that the script code calls all the needed info.

If I take the code I've provided above and paste it into a post, it works.  I've even done with with my html editor on a blank page, saved it and then previewed it in chrome and it worked fine.  So it didn't even have to be on a website to work it seems.

My guess is that a style of simple-press is interfering with the Po.st styles.  Is there a way to turn off all styles for a  few lines of code and then turn the styles back on again?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 20, 2014 - 12:34 am

well, interfering is not the word I would use... 😉  you are displaying them in the forum, so natural to assume the forum styles would dictate appearance...  but you are right, the po.st css is so generic that the more specific forum styles are being used instead...  would have been better if po.st had been specific so they would know their styles would get used...  I could see them getting overridden in many wp themes too...

so a few choices of how you want to proceed...

one, try removing the reset css in the forum styles of the theme you are using...  its an include so you can just comment it out...  with the reset css out of the way, you may get them to show... however, without the reset css, you may see the wp theme styles now overriding some forum styles...  could be catch 22...

two, copy the po.st css file and add it to your sp css and add the specific forum container to the various styles such that they are  more targeted...  the css file they use is at:  http://i.po.st/static/v3/css/r....._pch_601  downside to that is if they change it or you change how you invoke it, you might not stay current...

do some detective work with a good css inspector like firebug and figure out which reset css files are controlling the display... and only add those (probably a handful) ones that you need to override the forum css with in your sp theme...

Avatar
Trevor Lyman
Member
Free Members
sp_UserOfflineSmall Offline
Apr 20, 2014 - 5:57 am

The first suggestion seems to have done the trick.  The forum still looks good and the buttons show up now.

Thanks for your help!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 20, 2014 - 7:33 am

You're welcome and thanks for the update.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 643
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17343
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10117
Posts: 79590