Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
[postthanks-short-code] stopped working after update
Avatar
Ryan Collins_1
Member
sp_UserOfflineSmall Offline
Apr 11, 2017 - 10:38 am

Hello team,

I just updated my Simple Press and all my SP plugins and themes.

I noticed my [postthanks-short-code] code is no longer working in the footer of my forum and also in my blog sidebar widget. 

  • Do you know how to get it working again?
  • What is the best way for me to add this to my child theme so it doesn't happen again after the next upgrade?

Thank you for the support.

Blog-Sidebar-Widget.pngImage EnlargerForum-Footer.pngImage Enlarger

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 11, 2017 - 11:58 am

I will need to confer and confirm this with @mr-papa but I am pretty sure that we do not supply such a shortcode (postthanks-short-code). Could this be some custom code that has been written for you?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 11, 2017 - 9:19 pm

Nope. we dont have any shortcodes for that plugin - never have...

you can see a list of available template functions here:  https://simple-press.com/docum.....st-thanks/

agree with @yellow-swordfish sounds like some custom code... likely someone added a simple shortcode to call our template function... perhaps you could share the hook registering the shortcode?

Avatar
Ryan Collins_1
Member
sp_UserOfflineSmall Offline
Apr 12, 2017 - 3:02 pm

Thanks guys.

Yes it appears there was some custom coding added to the functions.php file:

function wpc_shortcode_postthanks(){

if (function_exists('sp_thanks_user_stats')) {

?><div  style="width:100%; margin:0px 0 10px; padding:0%; float: left; text-align: center;" >

<?php sp_thanks_user_stats('tagclass=spCenter spThanksUserStats', get_current_user_id(), '<span style="padding-top: 10px;">Thanked %THANKED% times</span>'); ?></div>

<?php } else{

//echo 'no action';

}

}

add_shortcode('postthanks-short-code','wpc_shortcode_postthanks'); ?>

 

So to preserve this shortcode through plugin updates, is it as simple as adding this custom code be added to the Child Theme functions.php?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 12, 2017 - 3:19 pm

That is correct. move it to the child theme. Move it - not copy it. Then it will remain safe.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Ryan Collins_1
Member
sp_UserOfflineSmall Offline
Apr 12, 2017 - 6:06 pm

Thank you.

I just have one last question which I ask in this quick video.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 12, 2017 - 8:59 pm

yes, the indicated location would be fine...

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: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625