Insert Share buttons into Blocks.

Posted in: Newsmag
Post count: 3

Hello,
Please I’m using a 3rd Part Sharing Plugin( Social Warfare Plugin), and i want to use it to insert sharing buttons after post title and date in blocks.

See example below.
http://www.screencast.com/t/Wl2HSJdvwH

That site also use same(Social Warfare plugin).

So please help me, that is the reason i bought this theme please.

Awaiting Your Positive Reply.

Thank You.

Best Regards.

Post count: 3

Update.
Please here is a link from the plugin developers on how to insert it.
https://warfareplugins.com/support/using-shortcodes-and-php-snippets/

Summary of the plugin.

Short Code- [social_warfare]

PHP function – social_warfare()

E.g

if(function_exists(‘social_warfare’)):
social_warfare();
endif;

Post count: 6535

Hi

The theme use modules on each block so to display the social icons on there you have to edit the corresponding with the module used. For example on block 3 we use module 1 to display posts so you have to edit td_module_1.php and add the code where you want to display the share icons: http://screencast.com/t/af9gRnK2 To check what modules are used on each block go to theme panel > categories tags on modules and blocks: http://screencast.com/t/tOClHKMV

Hope this helps.
Thanks!

Post count: 3

Hello Bro!

Thank You for your awesome and very helpful reply.

I have successfully inserted the icons into module 3.

But the plugin is presently sharing the homepage on alone.
http://www.screencast.com/t/b4PWWitwYN

Please what should I insert into the function, to pull individual Post Url instead.

Here is my code.

<?php

class td_module_3 extends td_module {

function __construct($post) {
//run the parrent constructor
parent::__construct($post);
}

function render() {
ob_start();
?>

<div class=”<?php echo $this->get_module_classes();?>”>
<div class=”td-module-image”>
<?php echo $this->get_image(‘td_300x194’);?>
<?php if (td_util::get_option(‘tds_category_module_3’) == ‘yes’) { echo $this->get_category(); }?>
</div>
<?php echo $this->get_title();?>

<div class=”meta-info”>
<?php echo $this->get_author();?>
<?php echo $this->get_date();?>
<?php echo $this->get_comments();?>

</div>
<?php if(function_exists(‘social_warfare’)):
social_warfare(array( ‘use_current_page’ => true ));
endif;

?>

<?php echo $this->get_quotes_on_blocks(); ?>

</div>

<?php return ob_get_clean();
}
}

Post count: 6535

Hi

I am not aware of plugin’s functionality and i can’t posit directly to a solution but basically you have to check how that plugin works for posts, by this I mean if there is any function/method which count how many times a post was shared. It seems that this function social_warfare() takes one parameter so you can pass it post’s id like here:

<?php if(function_exists(‘social_warfare’)):
social_warfare($this->post->ID);
endif;
?>

I am not sure that the function will generate the desired result but could be a starting point, basically post’s id must be sent as parameter in order to pick the individual shares for each post.
Hope this helps.
Thanks!

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