Adding a custom social network on social-counter

Posted in: Newspaper
Post count: 45

Hi everyone,

I am trying to integrate a new social network inside the social counter plugin. This social network is a minor one and does not have any api, so I don’t have to count the followers (I could set them manually like in the RSS feed one). While I have made some progress, I am still unable to have it show up in the widget. Here’s what I did:

1) Backend: td_social_counter.php

I added this to the array:


array(
"param_name" => "newwebsite",
"type" => "textfield",
"value" => 'Newwebsite',
"heading" => __("User Id", TD_THEME_NAME),
"description" => "",
"holder" => "div",
"class" => "tdc-textfield-big"
),

This works correctly

2) Backend: td_social_api.php


case 'newwebsite':
$td_data = td_remote_http::get_page("http://www.newwebsite.com/$user_id", __CLASS__);
break;

3) Frontend: td_block_social_counter.php


case 'newwebsite':
return array(
'button' => __td('Follow'),
'url' => "http://www.newwebsite.com/$user_id",
'text' => __td('Followers'),
'api' => $td_social_api->get_social_counter($service_id, $user_id, $access_token),
);
break;

4) CSS

I duplicated every -facebook class and changed it to -newwebsite. I tried t do this both on the child theme and on the main theme

The result is that nothing shows up on the widget 🙁 I amnot sure what I am missing so I hope you will be able to give me a pointer towards the right direction.

Thank you very much!

Post count: 22421

Hello,

When tackling such tasks it is recommended to know what you are doing. Custom modifications are not covered by the theme support but we do try to help out when we can so I will help you with this one, but please note that in future customization issues we suggest hiring a freelancer as time does not allow us to tackle customization tasks.

The issue is here: https://www.screencast.com/t/Tu7quACKO9hc
The code adds the html for the element only after getting the icon from the social icons array.
The array is found here: https://www.screencast.com/t/1YRWik9hCq6Q

Thank you!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.