Social Sharing // Homepage

Posted in: Newspaper
Post count: 6

Hi,

first of all many congrats for this brilliant template, this is just awesome.

I’ve already built up most parts of the site, but struggling with the following:

Is there any way to add this code block (sharing buttons + via source) below the teaser of each article on the homepage? (using Homepage – with article list) – if yes, where do I have to place it?


<?php echo $td_mod_single->get_source_and_via();?>
<?php echo $td_mod_single->get_social_sharing();?>

Many thanks!

Post count: 322

You would need to find the module that each block on your homepage is using and make the edit there. Just open the block source files for the blocks you’re using and it’ll tell you at the top which module it uses.

Blocks are located at includes > shortcodes
Modules are located at includes > modules

Post count: 6

thx for the quick answer, but if I do so, I’ll get the following:

Fatal error: Call to a member function get_source_and_via() on a non-object in /www/htdocs/w011e65d/wp-content/themes/Newspaper/includes/modules/td_module_5.php on line 23

Post count: 322

You misunderstood.

That’s where you make the edits but I offered nothing on the code you presented. From looking over the code I see that you would have to custom code this and it’s more advanced than simply copying code from file-A to file-B as the queries are not setup for it. The query you need for this isn’t in any of the blocks or modules and likely doesn’t exist.

Good luck.

Post count: 854

hi,
Kronos1723 is right, find the modules that you are using on your homepage and make the edit there.
how to find the modules: http://screencast.com/t/Ggg4wiuWu

if you are not a programmer my advice is to hire one for this task, will save time.

Thanks for you message.
Radu A.

  • This reply was modified 12 years by Radu A.
Post count: 6

many thanks, I’ll give it a try 🙂

Post count: 6

tried it several times, but my knowledge is not enough :/

Anyone here who isfamiliar with the code and offers customisation work?

Post count: 854

hi,
my advice is hire a programmer for this task, it will same time.

Thanks for you message.
Radu A.

Post count: 1

Similar problem here, i want to put the social get_social_sharing() in page.php and i get this error:

Fatal error: Call to a member function get_social_sharing() on a non-object in /wp-content/themes/Newspaper/page.php on line 79

Post count: 854

hi,
you can’t just copy the function get_social_sharing() in any file and aspect to work.
take a look where the function is defined : http://screencast.com/t/00VeQol9k ,
http://screencast.com/t/LoV20WHKIG .

if you take a look at the constructor of the ‘td_module_blog’ class where ‘get_social_sharing()’ you will see that you need a ‘post’, this is way the social sharing work on single post pages and not on pages with multiple posts.

Thanks for you message.
Radu A.

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